On Feb 17, 2015, at 08:52 PM, Paul Moore wrote: >I'm pretty sure that's the way the general feeling is going.
Though the more I think about it, the more I like sys.executable. :) >> However, -p must be able to accept any number of strings, including >> "/usr/bin/env python3" if the user wants that. > >The code simply writes >'#!{}\n'.format(p_option).encode(sys.filesystemencoding()) to the file, so >you can put whatever you want in. Given that it isn't the name of the Python >executable, maybe the option should be --interpreter instead? (Quoting out of order.) >I'm not quite sure what you mean here, but maybe you're thinking that >the -p option is the executable name rather than what gets put in the >#! line directly? Let me know if it's not covered by what I've already >said. I was thinking it would be useful to mimic virtualenv's -p/--python option, but I think that doesn't actually do the $PATH parsing, so maybe taking -p verbatim is fine. >Oh, and am I right that the shebang line should be encoded using the >filesystem encoding on Unix? I know 99.999% of use cases will be >ascii, but someone could have a Python interpreter in >/home/léon/.local/bin/python... Well, actually probably utf-8 in most cases, at least for Python 3 on *nix. 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. Cheers, -Barry
pgpwgqU3Yj0vR.pgp
Description: OpenPGP digital signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com