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 ucodery
Recipients FFY00, barry, eryksun, ucodery
Date 2021-10-26.03:31:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635219086.11.0.0989524719053.issue45545@roundup.psfhosted.org>
In-reply-to
Content
A LBYL won't always raise errors early as you point out. It will give earlier warnings for a lot of cases, but makes contextlib.chdir usable in less places than os.chdir.
Some return paths will always be errors, and some will be technically recoverable but too difficult to detect and or fragile. That's why I think any solution should incorporate the `ignore_errors` flag. Its pretty ugly to wrap a context manager in a try: except: just because you were trying to clean up after whatever you were doing but the cwd changed in unexpected ways, maybe out of your control.
History
Date User Action Args
2021-10-26 03:31:26ucoderysetrecipients: + ucodery, barry, eryksun, FFY00
2021-10-26 03:31:26ucoderysetmessageid: <1635219086.11.0.0989524719053.issue45545@roundup.psfhosted.org>
2021-10-26 03:31:26ucoderylinkissue45545 messages
2021-10-26 03:31:25ucoderycreate