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 chris.jerdonek
Recipients Arfrever, brett.cannon, chris.jerdonek, docs@python, eric.araujo, eric.smith, gennad, ncoghlan
Date 2012-07-16.15:39:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342453162.64.0.655246850951.issue14787@psf.upfronthosting.co.za>
In-reply-to
Content
> This isn't an easy one to fix - you basically need something along the lines of a PEP 406 style import engine API in order to do the import without having potentially adverse effects on the state in the sys module.

By adverse, do you just mean side effects? If so, since the documentation doesn't explicitly say so, is there any reason for the user to think there shouldn't be side effects?  For example, I tried this in Python 2.7:

>>> import os, sys, pkgutil, unittest
>>> len(sys.modules)
86
>>> g = pkgutil.walk_packages([os.path.dirname(unittest.__file__)])
>>> len(sys.modules)
86
>>> for i in g:
...   pass
... 
>>> len(sys.modules)
95

Or maybe this isn't what you mean. If not, can you provide an example?
History
Date User Action Args
2012-07-16 15:39:22chris.jerdoneksetrecipients: + chris.jerdonek, brett.cannon, ncoghlan, eric.smith, eric.araujo, Arfrever, docs@python, gennad
2012-07-16 15:39:22chris.jerdoneksetmessageid: <1342453162.64.0.655246850951.issue14787@psf.upfronthosting.co.za>
2012-07-16 15:39:22chris.jerdoneklinkissue14787 messages
2012-07-16 15:39:21chris.jerdonekcreate