[Python-Dev] PEP 441 - Improving Python ZIP Application Support

Serhiy Storchaka storchaka at gmail.com
Wed Feb 18 08:45:56 CET 2015


On 17.02.15 23:25, Barry Warsaw wrote:
> I'm not sure sys.getfilesystemencoding() is the right encoding, rather than
> sys.getdefaultencoding(), if you're talking about the encoding of the shebang
> line rather than the encoding of the resulting pyz filename.

On POSIX sys.getfilesystemencoding() is the right encoding because the 
shebang is read by system loader which doesn't encode/decode, but uses a 
file name as raw bytes string. On Mac OS always is UTF-8, but 
sys.getdefaultencoding() can be ASCII.



More information about the Python-Dev mailing list