On Wed, Jan 28, 2009 at 11:52 AM, Paul Moore <p.f.mo...@gmail.com> wrote: > Ah, I see. That is entirely obvious. The key bit of information is > that the default io encoding is cp1252, not cp850. I know that in > theory, I see the consequences often enough (:-)), but it isn't > "instinctive" for me. And the simple "default encoding is system > dependent" comment is not very helpful in terms of warning me that > there could be an issue. > > I do think that more wording around encoding defaults would be useful > - as I said, I'll think about how best it could be made into a doc > patch. I suspect the best approach would be to have a section (maybe > in the docs for the codecs module) explaining all the details, and > then a cross-reference to that from the various places (open, io) > where default encodings are mentioned.
It'd also help if the file repr gave the encoding: >>> f = open('/dev/null') >>> f <io.TextIOWrapper object at 0x7ff4468d8a90> >>> import sys >>> sys.stdout <io.TextIOWrapper object at 0x7ff4476126d0> Of course I can check .encoding manually, but it needs to be more intuitive. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com