Message138920
| Author |
vinay.sajip |
| Recipients |
alexis, eric.araujo, tarek, vinay.sajip |
| Date |
2011年06月24日.11:49:50 |
| SpamBayes Score |
5.3151256e-05 |
| Marked as misclassified |
No |
| Message-id |
<1308916191.0.0.321997794801.issue12395@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I can confirm that putting a list() around the generator allows the removal to proceed:
diff -r d2453f281baf Lib/packaging/install.py
--- a/Lib/packaging/install.py Fri Jun 24 10:21:46 2011 +0100
+++ b/Lib/packaging/install.py Fri Jun 24 12:48:33 2011 +0100
@@ -389,7 +389,10 @@
dist = get_distribution(project_name, use_egg_info=True, paths=paths)
if dist is None:
raise PackagingError('Distribution "%s" not found' % project_name)
- files = dist.list_installed_files(local=True)
+ # list_installed_files returns a generator, and we need the
+ # RECORD file itself closed so that we can move it - under Windows,
+ # you can't move an opened file
+ files = list(dist.list_installed_files(local=True))
rmdirs = []
rmfiles = []
tmp = tempfile.mkdtemp(prefix=project_name + '-uninstall')
The error message does need fixing, though, for cases where something else has a distribution's files open. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月24日 11:49:58 | vinay.sajip | unlink | issue12395 messages |
| 2011年06月24日 11:49:51 | vinay.sajip | set | recipients:
+ vinay.sajip, tarek, eric.araujo, alexis |
| 2011年06月24日 11:49:51 | vinay.sajip | set | messageid: <1308916191.0.0.321997794801.issue12395@psf.upfronthosting.co.za> |
| 2011年06月24日 11:49:50 | vinay.sajip | link | issue12395 messages |
| 2011年06月24日 11:49:50 | vinay.sajip | create |
|