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 brett.cannon
Recipients brett.cannon, djc, ncoghlan
Date 2012-11-28.18:08:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354126134.18.0.699700564492.issue16570@psf.upfronthosting.co.za>
In-reply-to
Content
When you execute a module on the command line, sys.path[0] is set to that containing directory (e.g. pkg/tests in your example; just have pkg/tests/__init__.py print out sys.path to see what I mean). ``import http`` is going to look on sys.path no matter what, and with ``pkg/tests`` being the first entry on sys.path, its going to find pkg/tests/http.py before it even has a chance to look in the directory containing the stdlib. A bare import only means "look on sys.path", not "magically only look in the stdlib".
History
Date User Action Args
2012-11-28 18:08:54brett.cannonsetrecipients: + brett.cannon, ncoghlan, djc
2012-11-28 18:08:54brett.cannonsetmessageid: <1354126134.18.0.699700564492.issue16570@psf.upfronthosting.co.za>
2012-11-28 18:08:54brett.cannonlinkissue16570 messages
2012-11-28 18:08:54brett.cannoncreate