[issue22022] test_pathlib: shutil.rmtree() sporadic failures on Windows

STINNER Victor report at bugs.python.org
Mon Jul 21 18:05:04 CEST 2014


New submission from STINNER Victor:

Sometimes, test_pathlib fails because shutil.rmtree() cannot remove a test directory. Example:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/4833/steps/test/logs/stdio

======================================================================
ERROR: test_touch_common (test.test_pathlib.WindowsPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 477, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 376, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\shutil.py", line 374, in _rmtree_unsafe
    os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 'C:\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_3444\\@test_3444_tmp\\dirB'

The error comes from this cleanup function:

        self.addCleanup(shutil.rmtree, BASE)

I don't understand how rmtree() can fail with "The directory is not empty".

Note: this buildbot runs 4 tests in parallel using the "-j4" command line option of regrtest.

----------
components: Tests, Windows
keywords: buildbot
messages: 223584
nosy: haypo
priority: normal
severity: normal
status: open
title: test_pathlib: shutil.rmtree() sporadic failures on Windows
versions: Python 3.4, Python 3.5

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


More information about the Python-bugs-list mailing list