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 Arfrever, brett.cannon, eric.snow, martin.panter, r.david.murray
Date 2014-11-14.14:38:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1415975928.76.0.929070727338.issue22834@psf.upfronthosting.co.za>
In-reply-to
Content
So it isn't about importlib not handling missing directories on sys.path directly, it has to do with the fact that os.getcwd() raises FileNotFoundError when CWD is no longer valid and that is in a fundamental part of importlib that isn't worrying about non-existent directories.

We could be robust and simply have instances of os.getcwd() failing just move on, e.g. when '' is hit in sys.path and os.getcwd() raises an exception just give up. The other option is leaving this to raise FileNotFoundError but throwing a new copy with a better error message mentioning this is because the current working directory no longer exists. That would lead to easier debugging since paths on sys.path are typically obvious -- since site.py makes them absolute -- but I'm willing to bet people don't bother checking CWD is still good. So it's robustness vs. debugging when you make this mistake.

Any opinions on the matter?
History
Date User Action Args
2014-11-14 14:38:48brett.cannonsetrecipients: + brett.cannon, Arfrever, r.david.murray, eric.snow, martin.panter
2014-11-14 14:38:48brett.cannonsetmessageid: <1415975928.76.0.929070727338.issue22834@psf.upfronthosting.co.za>
2014-11-14 14:38:48brett.cannonlinkissue22834 messages
2014-11-14 14:38:47brett.cannoncreate