Re: reload(sys)
- From: Steven Bethard <steven.bethard@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 11:09:54 -0600
Sönmez Kartal wrote:
On 31 A ustos, 04:24, Steven Bethard <steven.beth...@xxxxxxxxx> wrote:Sönmez Kartal wrote:I've had an encoding issue and solved it bysys.setdefaultencoding is purposely deleted from the sys module after
"sys.setdefaultencoding('utf-8')"...
My first try wasn't successful since setdefaultencoding is not named
when I imported sys module. After, I import sys module, I needed to
write "reload(sys)" also.
I wonder why we need to call "reload(sys)" to get setdefaultencoding
named?
it's loaded because you really shouldn't be using it. The reload() call
restores the deleted attribute.
If you'd like a less brittle solution to your encoding issue, explain
what the issue was, and people here can probably help you find a better
solution.
STeVe
I was using the XMLBuilder(xmlbuilder.py). I'm writing XML files as
"f.write(str(xml))". At execution of that line, it gives error with
description, configure your default encoding...
Could you post the actual traceback you're getting?
STeVe
.
- References:
- reload(sys)
- From: Sönmez Kartal
- Re: reload(sys)
- From: Steven Bethard
- Re: reload(sys)
- From: Sönmez Kartal
- reload(sys)
- Prev by Date: Re: strings (dollar.cents) into floats
- Next by Date: Re: Biased random?
- Previous by thread: Re: reload(sys)
- Next by thread: Coding Standards
- Index(es):
Relevant Pages
|