[ python-Bugs-1764407 ] The -m switch does not use the builtin __main__ module

SourceForge.net noreply at sourceforge.net
Tue Jul 31 14:43:51 CEST 2007


Bugs item #1764407, was opened at 2007-07-31 22:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1764407&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nick Coghlan (ncoghlan)
Assigned to: Nick Coghlan (ncoghlan)
Summary: The -m switch does not use the builtin __main__ module

Initial Comment:
The -m switch creates a new module object to execute the requested module, and then throws it away before returning control to the interpreter core.

This is incompatible with the -i command line switch (and its environment variable equivalent), and would also cause problems if any code executed while looking for the module to be executed (e.g. sitecustomize.py or package __init__ modules) grabbed a reference to the original __main__ module.

(Creating bug report because I don't think the quick fix I checked in to SVN is adequate, and it's taking me longer than I planned to roll the quick fix back and fix the problem properly)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1764407&group_id=5470


More information about the Python-bugs-list mailing list