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 thomas.holmes
Recipients alexis, eric.araujo, tarek, thomas.holmes
Date 2011-07-06.04:34:40
SpamBayes Score 3.1215702e-06
Marked as misclassified No
Message-id <1309926881.7.0.734520391359.issue12504@psf.upfronthosting.co.za>
In-reply-to
Content
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>
History
Date User Action Args
2011-07-06 04:34:41thomas.holmessetrecipients: + thomas.holmes, tarek, eric.araujo, alexis
2011-07-06 04:34:41thomas.holmessetmessageid: <1309926881.7.0.734520391359.issue12504@psf.upfronthosting.co.za>
2011-07-06 04:34:41thomas.holmeslinkissue12504 messages
2011-07-06 04:34:40thomas.holmescreate