[issue12504] Uninstall has disabled windows tests

Thomas Holmes report at bugs.python.org
Wed Jul 6 06:34:41 CEST 2011


New submission from Thomas Holmes <thomas at devminded.com>:

Functions test_uninstall.test_uninstall and test_uninstall.test_remove_issue were disabled for win32. Upon enabling them they generated failures.

I have worked up a patch that refactors a packaging.Distribution function _get_records from using a generator to returning a list. The generator function was holding open the RECORD file that it is trying to delete, resulting in failure.

I've tried to follow the protocol for a distutils2 patch as shown here (http://wiki.python.org/moin/Distutils/Contributing) so hopefully I've got this remote repository pointing correct.

> packaging.tests.test_uninstall -v
test_remove_issue (__main__.UninstallTestCase) ... ERROR
FAIL
test_uninstall (__main__.UninstallTestCase) ... ERROR
FAIL
test_uninstall_unknow_distribution (__main__.UninstallTestCase) ... ok

======================================================================
ERROR: test_remove_issue (__main__.UninstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\python\dev\cpython\lib\packaging\tests\test_uninstall.py", line 48, in tearDown
    super(UninstallTestCase, self).tearDown()
  File "D:\python\dev\cpython\lib\packaging\tests\support.py", line 134, in tearDown
    shutil.rmtree(self._basetempdir)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 284, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "D:\python\dev\cpython\lib\shutil.py", line 282, in rmtree
    os.remove(fullname)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'd:\\temp\\tmpy
6drm5\\tmp6htvi1\\Lib\\site-packages\\Meh-0.1.dist-info\\RECORD'

======================================================================
ERROR: test_uninstall (__main__.UninstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\python\dev\cpython\lib\packaging\tests\test_uninstall.py", line 48, in tearDown
    super(UninstallTestCase, self).tearDown()
  File "D:\python\dev\cpython\lib\packaging\tests\support.py", line 134, in tearDown
    shutil.rmtree(self._basetempdir)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 279, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "D:\python\dev\cpython\lib\shutil.py", line 284, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "D:\python\dev\cpython\lib\shutil.py", line 282, in rmtree
    os.remove(fullname)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'd:\\temp\\tmp4
23fq4\\tmpp2v6uq\\Lib\\site-packages\\Foo-0.1.dist-info\\RECORD'

======================================================================
FAIL: test_remove_issue (__main__.UninstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\python\dev\cpython\lib\packaging\tests\test_uninstall.py", line 124, in test_remove_issue
    self.assertTrue(remove('Meh', paths=[install_lib]))
AssertionError: False is not true

======================================================================
FAIL: test_uninstall (__main__.UninstallTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\python\dev\cpython\lib\packaging\tests\test_uninstall.py", line 102, in test_uninstall
    self.assertTrue(remove('Foo', paths=[install_lib]))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 3 tests in 0.120s

FAILED (failures=2, errors=2)
[145911 refs]

D:\python\dev\cpython\PCbuild>

----------
hgrepos: +37

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


More information about the Python-bugs-list mailing list