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 jaraco
Recipients jaraco
Date 2010-04-05.17:24:17
SpamBayes Score 4.6129767e-13
Marked as misclassified No
Message-id <1270488260.7.0.624220930721.issue8317@psf.upfronthosting.co.za>
In-reply-to
Content
Using Windows 7 32-bit, and /branches/py3k@79802.

When I run the test_tarfile from the regrtest script, often the first run will succeed and subsequent runs will fail (though sometimes a first run will fail and rarely a subsequent run will succeed). It appears to be a timing issue. The output from a failed attempt is included below.

Passing -v to the regrtest script prevents the failure from occurring. Also disabling test_extract_hardlink test prevents the failure from occurring in most cases. I found that enabling pdb and setting a trace in test_extract_hardlink prevented the error from occurring. I also attempted closing the tarfile explicitly (including in a finally block) and putting time.sleep(1) at the beginning or end of that test, but that seemed to have no effect.

I am beginning to suspect that this problem is related to an indexer or malware scanner on the system checking the file after it's created, causing it to be locked at the time it's scheduled to be deleted.

PS C:\Users\jaraco\projects\public\python-core-3.x-svn> pcbuild\python .\lib\test\regrtest.py test_tarfile
test_tarfile
test test_tarfile crashed -- <class 'WindowsError'>: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\jaraco\\projects\\public\\python-core-3.x-svn\\build\\test_python_5196\\@test_5196_tmp\\testtar.tar.gz'
'test_tarfile' left behind directory '@test_5196_tmp' and it couldn't be removed: [Error 32] The process cannot access the file because it is being used by another process: '@test_5196_tmp\\testtar.tar.gz'
1 test failed:
    test_tarfile
Traceback (most recent call last):
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 400, in temp_cwd
    yield os.getcwd()
  File ".\lib\test\regrtest.py", line 1473, in <module>
    main()
  File ".\lib\test\regrtest.py", line 687, in main
    sys.exit(len(bad) > 0 or interrupted)
SystemExit: True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\lib\test\regrtest.py", line 1473, in <module>
    main()
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 404, in temp_cwd
    rmtree(name)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\test\support.py", line 184, in rmtree
    shutil.rmtree(path)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", line 251, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", line 256, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "C:\Users\jaraco\projects\public\python-core-3.x-svn\lib\shutil.py", line 254, in rmtree
    os.remove(fullname)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\jaraco\\projects\\public\\python-core-3.x-svn\\build\\test_python_5196\\@test_5196_tmp\\testtar.tar.gz'
History
Date User Action Args
2010-04-05 17:24:20jaracosetrecipients: + jaraco
2010-04-05 17:24:20jaracosetmessageid: <1270488260.7.0.624220930721.issue8317@psf.upfronthosting.co.za>
2010-04-05 17:24:19jaracolinkissue8317 messages
2010-04-05 17:24:17jaracocreate