[Python-checkins] r65644 - in python/trunk: Lib/shutil.py Misc/NEWS
antoine.pitrou
python-checkins at python.org
Mon Aug 11 19:21:36 CEST 2008
Author: antoine.pitrou
Date: Mon Aug 11 19:21:36 2008
New Revision: 65644
Log:
#3134: shutil referenced undefined WindowsError symbol
Modified:
python/trunk/Lib/shutil.py
python/trunk/Misc/NEWS
Modified: python/trunk/Lib/shutil.py
==============================================================================
--- python/trunk/Lib/shutil.py (original)
+++ python/trunk/Lib/shutil.py Mon Aug 11 19:21:36 2008
@@ -16,6 +16,11 @@
class Error(EnvironmentError):
pass
+try:
+ WindowsError
+except NameError:
+ WindowsError = None
+
def copyfileobj(fsrc, fdst, length=16*1024):
"""copy data from file-like object fsrc to file-like object fdst"""
while 1:
@@ -162,11 +167,12 @@
errors.extend(err.args[0])
try:
copystat(src, dst)
- except WindowsError:
- # can't copy file access times on Windows
- pass
except OSError, why:
- errors.extend((src, dst, str(why)))
+ if WindowsError is not None and isinstance(why, WindowsError):
+ # Copying file access times may fail on Windows
+ pass
+ else:
+ errors.extend((src, dst, str(why)))
if errors:
raise Error, errors
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Mon Aug 11 19:21:36 2008
@@ -44,6 +44,8 @@
Library
-------
+- Issue #3134: shutil referenced undefined WindowsError symbol.
+
- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
menu entries were not deleted.
More information about the Python-checkins
mailing list