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.
Created on 2008年10月24日 18:44 by vajda, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| patch.2751.diff | vajda, 2008年10月24日 18:44 | patch to runpy.py | ||
| issue4195_runpy_package_support.diff | ncoghlan, 2008年10月25日 06:25 | Updated patch with test cases and doc updates | ||
| Messages (4) | |||
|---|---|---|---|
| msg75175 - (view) | Author: vajda (vajda) | Date: 2008年10月24日 18:44 | |
Copy of #2751. Having discussed this with Nick a bit more over email, he suggested that package execution could actually be properly supported by looking for a __main__ module inside the package and executing it instead. This is consistent with the way .zip archives are executed and would neatly resolve this problem. I attached a simple patch implementing this. Nick also said that fixing this might be considered a new feature and might have to wait until 2.7. Given that this worked on Python 2.5, albeit unintentionally, I'd argue that this is closer to a fix of a somewhat buggy Python 2.5 feature than a new feature in 2.6. |
|||
| msg75203 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2008年10月25日 06:25 | |
Added revised version of patch with test cases and documentation updates, as well as fixing a potential recursion issue with pathological packages where __main__ was also a package) |
|||
| msg76560 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2008年11月28日 22:32 | |
Missed the window for 2.6/3.0. Guido agreed on python-dev that it counts as a new feature, so it was definitely out for the already-released 2.6, and also wasn't really an option for the release candidate phase of 3.0. Assigning to myself for 2.7/3.1 - I'll put it in once the 3.0 maintenance branch has been cut (so I can update both 2.x and 3.x at the same time. For 2.6 and 3.0 though, short run scripts such as "python -m jcc.main" are going to be the order of the day. |
|||
| msg81362 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2009年02月08日 01:59 | |
Incorporated as: 2.7: r69419 3.1: r69421 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:40 | admin | set | github: 48445 |
| 2009年02月08日 01:59:36 | ncoghlan | set | status: open -> closed resolution: accepted messages: + msg81362 stage: resolved |
| 2008年11月28日 22:32:48 | ncoghlan | set | priority: normal assignee: ncoghlan messages: + msg76560 versions: + Python 3.1, Python 2.7, - Python 2.6 |
| 2008年10月25日 06:25:31 | ncoghlan | set | files:
+ issue4195_runpy_package_support.diff keywords: + patch messages: + msg75203 |
| 2008年10月24日 18:44:58 | vajda | create | |