Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • How exactly did I try to encode twice, since I just opened a file object? Isn't codec.open just opened a file object stream indicating it's encoding? Commented Jun 21, 2010 at 16:11
  • 2
    According to the docs of codecs.open: "Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding.". In other words, if you open a file for writing with codecs.open, it will transparently encode everything you write into it to UTF-8 first. Commented Jun 21, 2010 at 20:13
  • I thought "providing transparent encoding/decoding" was too subjective. I think if I need to understand more I just have to read the source. Commented Jun 22, 2010 at 12:10