Message175996
| Author |
barry |
| Recipients |
barry |
| Date |
2012年11月20日.15:17:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1353424635.18.0.600046275263.issue16514@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
When sys.path[0] is None, attempting to import a module produces a cryptic chained traceback. This is a regression from 3.2 where the import would succeed.
The basic issue is that in 3.2's import.c, non-string/bytes items on sys.path are essentially ignored (see the loop in import.c:1708 find_module()) while they are not ignored in 3.3's importlib. This means that because zipimporter.zipimiporter is by default the first thing on sys.path_hooks, zipimporter.zipimporter(None) gets called. This raises a TypeError which starts the chained exception. Note that the fact that zipimporter.zipimporter(None) raises a TypeError is *not* a regression. The regression is that None makes its way to sys.path_hooks at all.
I think this will be relatively easy to fix, if we agree that the current regressive behavior is a bug. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年11月20日 15:17:15 | barry | set | recipients:
+ barry |
| 2012年11月20日 15:17:15 | barry | set | messageid: <1353424635.18.0.600046275263.issue16514@psf.upfronthosting.co.za> |
| 2012年11月20日 15:17:15 | barry | link | issue16514 messages |
| 2012年11月20日 15:17:14 | barry | create |
|