[issue12395] packaging remove fails under Windows

Vinay Sajip report at bugs.python.org
Fri Jun 24 14:07:31 CEST 2011


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

We could fix the error message, for example, like this:

--- a/Lib/packaging/install.py	Fri Jun 24 10:21:46 2011 +0100
+++ b/Lib/packaging/install.py	Fri Jun 24 13:06:08 2011 +0100
@@ -412,6 +415,7 @@
                     error = _move_file(file_, tmpfile)
                     if error is not None:
                         success = False
+                        failed_on = file_
                         break
                 finally:
                     if not os.path.isfile(file_):
@@ -425,7 +429,7 @@
 
     if not success:
         logger.info('%r cannot be removed.', project_name)
-        logger.info('Error: %s' % str(error))
+        logger.info('Error: %s: %s' % (error, failed_on))
         return False
 
     logger.info('Removing %r: ', project_name)

----------

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


More information about the Python-bugs-list mailing list