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 gsakkis
Recipients brett.cannon, gsakkis, hauser, mrts
Date 2010-04-15.18:30:28
SpamBayes Score 1.4654944e-13
Marked as misclassified No
Message-id <1271356230.96.0.541053900654.issue2090@psf.upfronthosting.co.za>
In-reply-to
Content
Just bitten by this (through a 3rd party library that uses this pattern) and I'm wondering why it was closed as invalid. Passing a non-empty fromlist string also imports the tail module but without the side effect of double import, so it's not generally harmful. More surprisingly, a colleague discovered accidentally that the same behavior happens if you pass one or more slashes: __import__('pkg', fromlist=['', '/', '//']) imports 'pkg', 'pkg.', 'pkg./' and 'pkg.//' !

I'm not arguing that using fromlist to import the tail module is not a hack, but the behavior for empty strings and slashes (and whatever else causes multiple imports) is clearly a bug. Unless someone is actually relying on this double import behavior (very unlikely), I think it should be fixed.
History
Date User Action Args
2010-04-15 18:30:31gsakkissetrecipients: + gsakkis, brett.cannon, hauser, mrts
2010-04-15 18:30:30gsakkissetmessageid: <1271356230.96.0.541053900654.issue2090@psf.upfronthosting.co.za>
2010-04-15 18:30:29gsakkislinkissue2090 messages
2010-04-15 18:30:29gsakkiscreate