Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3441] Regression in "module as a script" command-line option

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 24, 2008, 9:09 PM

Post #1 of 7 (227 views)
Permalink
[issue3441] Regression in "module as a script" command-line option

New submission from Richard Jones <richardjones[at]optushome.com.au>:

The Python 2.5 "-m" command-line option allowed execution of a package
directly, by invoking the __init__.py module.

Python 2.6 no longer allows this.

This is a quite unfortunate regression, and I would urge the decision to
hobble it to be reconsidered.

----------
messages: 70240
nosy: richard
severity: normal
status: open
title: Regression in "module as a script" command-line option
versions: Python 2.6

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 24, 2008, 9:10 PM

Post #2 of 7 (221 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Changes by Richard Jones <richardjones[at]optushome.com.au>:


----------
type: -> behavior

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 25, 2008, 12:09 AM

Post #3 of 7 (229 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Changes by Georg Brandl <georg[at]python.org>:


----------
assignee: -> ncoghlan
nosy: +ncoghlan

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 25, 2008, 5:33 AM

Post #4 of 7 (218 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Benjamin Peterson <musiccomposition[at]gmail.com> added the comment:

Please see #2751.

----------
nosy: +benjamin.peterson
resolution: -> duplicate
status: open -> closed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 25, 2008, 11:40 PM

Post #5 of 7 (213 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Nick Coghlan <ncoghlan[at]gmail.com> added the comment:

Now, if someone was to provide a 2.7 rfe with associated patch that
implements this feature properly, and includes an explanation for why it
doesn't subtly break imports the way 2.5 does, that would be a
completely different story.

But it isn't as simple as just getting rid of the explicit check that
prevents packages from being executed.

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 25, 2008, 11:48 PM

Post #6 of 7 (210 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Richard Jones <richardjones[at]optushome.com.au> added the comment:

I'm afraid it's all a bit opaque to an outsider like me. I've no idea
what subtle breakage the feature was causing. I just saw it working
quite nicely for me in 2.5 :)

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 26, 2008, 12:10 AM

Post #7 of 7 (212 views)
Permalink
[issue3441] Regression in "module as a script" command-line option [In reply to]

Nick Coghlan <ncoghlan[at]gmail.com> added the comment:

If I recall correctly (it's been a while), the breakages were tied in
with relative imports - probably something like explicit relative
imports not working at all, and implicit relative imports appearing to
work, but resulting in incorrect module names and sys.modules entries
(similar to running a file from inside a package directly).

Doing "python -m package.__init__" instead of "python -m package" is
actually better behaved (although still a little odd - the
__init__ module code gets run once on the actual package import, and
then again as __main__).

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.