[issue22834] Unexpected FileNotFoundError when current directory is removed

Martin Panter report at bugs.python.org
Tue Feb 17 04:23:11 CET 2015


Martin Panter added the comment:

I don’t have a Solaris to test this, but maybe changing the first half of the test to the following would work:

dir = tempfile.TemporaryDirectory()
self.addCleanup(dir.cleanup)  # In case removal after chdir() fails
self.addCleanup(os.chdir, os.getcwd())
os.chdir(dir.name)
try:
    dir.cleanup()
except OSError as err:  # Invalid argument on Solaris
    self.skipTest("Couldn't remove current directory: {}".format(err))

with util.import_state(...)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22834>
_______________________________________


More information about the Python-bugs-list mailing list