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 jaraco
Recipients jaraco
Date 2017-10-26.14:01:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509026474.72.0.213398074469.issue31874@psf.upfronthosting.co.za>
In-reply-to
Content
In [this comment](https://bugs.python.org/issue16737#msg282872) I describe an issue whereby launching an application via runpy.run_module (aka python -m) produces different and unexpected behavior than running the same app via an entry script.

In [this followup comment](https://bugs.python.org/issue16737#msg304662), I provide more detail on why a user might expect for run_module to mimic the behavior of launching a script.

[Nick suggests](https://bugs.python.org/issue16737#msg304707):

> Update sys.path[0] based on __main__.__spec__.origin after [resolving] __main__.__spec__. That way it will only stay as the current directory if the module being executed is in a subdirectory of the current directory, and will otherwise be updated appropriately for wherever we actually found the main module.
History
Date User Action Args
2017-10-26 14:01:14jaracosetrecipients: + jaraco
2017-10-26 14:01:14jaracosetmessageid: <1509026474.72.0.213398074469.issue31874@psf.upfronthosting.co.za>
2017-10-26 14:01:14jaracolinkissue31874 messages
2017-10-26 14:01:14jaracocreate