Re: [Linux-SIG] Revisit of PEP 394 -- The "python" Command on Unix-Like Systems
Nick Coghlan wrote:
Another variant of that idea would be to have the default handler be something like Geoffrey Thomas's pythonmux project (https://github.com/geofft/pythonmux),
Yep, that's the project I was thinking of. I still like this proposal best, although I might quibble about some details (I'll do that on Thomas's GH project). It gives control to the right principles, i.e. the script author, or the person invoking the script (via environment variable), and doesn't require much from either the system administrator or the platform vendor, other than of course putting pythonmux on /usr/bin/python. I think this also nicely supports the interactive use case, so it kills two birds with one stone.
and then patch sys.excepthandler to report the Python version executed when "sys.executable" isn't qualified as either Python 2 or Python 3 for easier debugging of otherwise potentially cryptic error messages.
I do think it would be a good to have a diagnostic mode. I'm not sure that should be the default or not.
If we did do that, then I'd skip the "pyversions" comment idea, and instead have the logic just be:
- if only /usr/bin/python2 is present, use it - if only /usr/bin/python3 is present, use it - if both are present, use /usr/bin/python2
Why don't you like the pyversions comment? I think he has the syntax wrong in his blog post, but I'd have to verify that. I still think it's worthwhile to keep. Cheers, -Barry
participants (1)
-
Barry Warsaw