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 ncoghlan
Recipients barry, benjamin.peterson, illume, ncoghlan
Date 2009-07-10.09:07:59
SpamBayes Score 8.65974e-15
Marked as misclassified No
Message-id <1247216882.57.0.564008608806.issue2751@psf.upfronthosting.co.za>
In-reply-to
Content
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 between packages and modules matters is that
the import system has to do more bookkeeping for packages (since they
can contain modules and subpackages). Direct execution of packages was
meant to be disallowed because the Python 2.5 accident means the
__init__ module runs without that extra bookkeeping having been set up
properly, which can lead to a broken import system. Unfortunately, the
relevant error message was lost for 2.5 in a refactoring that merged
duplicated code from a couple of different parts of the standard library.

I added Barry to the nosy list as the 2.6 release manager. I'm reluctant
to re-enable a known-broken behaviour at all, but if Barry thinks it
would be worthwhile downgrading this to a DeprecationWarning rather than
an outright error in the next 2.6 maintenance then I would be willing to
do that. That would still leave you with people getting a warning
though, so I don't think it would be that much of a gain in practice.
History
Date User Action Args
2009-07-10 09:08:02ncoghlansetrecipients: + ncoghlan, barry, illume, benjamin.peterson
2009-07-10 09:08:02ncoghlansetmessageid: <1247216882.57.0.564008608806.issue2751@psf.upfronthosting.co.za>
2009-07-10 09:08:00ncoghlanlinkissue2751 messages
2009-07-10 09:08:00ncoghlancreate