[issue45545] chdir __exit__ is not safe

Barry A. Warsaw report at bugs.python.org
Mon Oct 25 22:04:19 EDT 2021


Barry A. Warsaw <barry at python.org> added the comment:

Does a LBYL strategy actually fix the problem?  E.g. what if the directory gets rm'd between __enter__ and __exit__?  Maybe we shouldn't try to be clever at all and just leave it to the user to decide what to do, and how to handle any chdir-back failures?  Keep it simple?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45545>
_______________________________________


More information about the Python-bugs-list mailing list