This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sworddragon
Recipients Sworddragon, a.badger, bkabrda, larry, lemburg, loewis, ncoghlan, pitrou, r.david.murray, serhiy.storchaka, terry.reedy, vstinner
Date 2013-12-09.04:03:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386561830.94.0.170501136856.issue19846@psf.upfronthosting.co.za>
In-reply-to
Content
You should keep things more simple:

- Python and the operation system/filesystem are in a client-server relationship and Python should validate all.
- It doesn't matter what you will finally decide to be the default encoding on various places - all will provide race-conditions with no exception.
- The easiest way to fix this is to give the developer the ability to make a decision (like sys.use_strict_encoding(), sys.setfilesystemencoding(), sys.setdefaultencoding() etc.).
* For example giving the developer control is especially needed if he wants to handle multiple different filesystems.


> Why do you think that the issue is specific to Python 3? Try to open a
> terminal with LC_ALL=C and try to type non-ASCII characters with your
> keyboard. You can't because your terminal uses ASCII.

sworddragon@ubuntu:~$ LANG=C
sworddragon@ubuntu:~$ ä
bash: $'\303\244': command not found

- The terminal doesn't pseudo-crash with an exception because it doesn't matter about encodings.
- It allows to change the encoding at runtime.


> Did you
> applications written in another language handling Unicode, like Perl?

Compare C: It wouldn't matter like the terminal. For example fopen will simply return NULL if it can't open the file 'ä' because the filesystem is endoded with ISO-8859-1 and we wanted to open the utf-8 counterpart.


> Can you explain the "various reasons" why users explictly force the
> encoding to ASCII?

For example I'm using this for testcases to set the language uncomplicated to english.
History
Date User Action Args
2013-12-09 04:03:51Sworddragonsetrecipients: + Sworddragon, lemburg, loewis, terry.reedy, ncoghlan, pitrou, vstinner, larry, a.badger, r.david.murray, serhiy.storchaka, bkabrda
2013-12-09 04:03:50Sworddragonsetmessageid: <1386561830.94.0.170501136856.issue19846@psf.upfronthosting.co.za>
2013-12-09 04:03:50Sworddragonlinkissue19846 messages
2013-12-09 04:03:50Sworddragoncreate