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 ronaldoussoren
Recipients Gabriel Corona, ronaldoussoren, vstinner, xtreak
Date 2019-02-12.15:08:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I don't know a good reason for including $PWD in sys.path for "python -m", I expect only scripts that run other scripts (such as might want the current behaviour and those can adjust to new behaviour.

For "python -c CMD" the current behaviour is easier to defend, this matches the behaviour w.r.t. sys.path of typing the command in an interactive session.

The behaviour for scripts (add the directory where the script is located to sys.path) is also easier to defend: that makes it easier to use scripts without installing stuf and without explicitly managing sys.path. 

I've used this in the past to split scripts into modules without installing modules in a global directory, but these days I tend to use virtual environment for that. I guess the usefulness of this behaviour depends on the type of user: the current behaviour is useful for more casual use of Python (which includes people learning python)
Date User Action Args
2019-02-12 15:08:07ronaldoussorensetrecipients: + ronaldoussoren, vstinner, Gabriel Corona, xtreak
2019-02-12 15:08:07ronaldoussorensetmessageid: <>
2019-02-12 15:08:07ronaldoussorenlinkissue35971 messages
2019-02-12 15:08:07ronaldoussorencreate