New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_pathlib: "The directory is not empty" error on os.rmdir() #64010
Comments
test_pathlib should use test.support.rmtree() instead of shutil.rmtree(). The function in support tries harder on Windows. test_pathlib may also create an unique temporary directory at each test run instead of using a global variable BASE: see below, tests are failing because the directory already exist. (Well, this issue is a consequence of the first one.) ====================================================================== 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 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_4528\\@test_4528_tmp\\dirC\\dirD' ====================================================================== Traceback (most recent call last):
File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_pathlib.py", line 1081, in setUp
os.mkdir(BASE)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_4528\\@test_4528_tmp' ====================================================================== Traceback (most recent call last):
File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_pathlib.py", line 1081, in setUp
os.mkdir(BASE)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_4528\\@test_4528_tmp' ====================================================================== Traceback (most recent call last):
File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_pathlib.py", line 1081, in setUp
os.mkdir(BASE)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_4528\\@test_4528_tmp' |
New changeset 1db5cde4958f by Victor Stinner in branch '3.4': New changeset e405bcbf761c by Victor Stinner in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: