[issue2751] Regression for executing packages

2009-07-10 Thread Nick Coghlan
Nick Coghlan added the comment: If you need to support Python 2.6 as well as 3.1, the simplest thing to do is just tell people to run "pygame.tests.main" always (i.e. completely skip the idea of executing the package directly and always run a submodule instead). The reason the distinction betwe

[issue2751] Regression for executing packages

2009-07-09 Thread Rene Dudfield
Rene Dudfield added the comment: hello, thanks for the explanation of why it's that way. Any ideas of a work around? python2.5 has been out for ages now. Even if it was an accident, it's the behavior people expect, and it's still a regression. Also, why should it matter if a module is a p

[issue2751] Regression for executing packages

2009-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: It doesn't work in 2.6 or 3.0 because, as stated above, it was only due to a bug that it even appeared to work at all in 2.5 (it was always meant to be disallowed because it puts dodgy data in the import machinery's internal records if you do it). It took a new f

[issue2751] Regression for executing packages

2009-07-09 Thread Rene Dudfield
Rene Dudfield added the comment: Hi, note -m on packages still works with python3.0 and python3.1. It works by allowing a __main__.py file that gets called by -m. This is a really annoying regression for python2.6. It's a fairly wide spread feature too. I can't see any PEP for why this regr

[issue2751] Regression for executing packages

2008-10-13 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: (Adding some additional details regarding the reasons why this became an error again in 2.6) The ImportError when attempting to execute a package was lost during the conversion from the C-based implementation in 2.4 to the runpy module based im

[issue2751] Regression for executing packages

2008-05-03 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- assignee: -> ncoghlan nosy: +ncoghlan __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-li

[issue2751] Regression for executing packages

2008-05-03 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: The ability to execute packages was never intended, since doing so breaks imports in a variety of subtle ways. It was actually a bug in 2.5 that it was permitted at all, so 2.6 not only disabled it again, but also added a test to make sure it st

[issue2751] Regression for executing packages

2008-05-03 Thread Benjamin Peterson
New submission from Benjamin Peterson <[EMAIL PROTECTED]>: If I have a package like this: pack/ __init__.py and __init__.py looks like this if __name__ == "__main__": print "Spam" python -m pack gives one is a package and cannot be directly executed This is regression from 2.5 where "