[Python-checkins] r73250 - python/trunk/Lib/shutil.py

benjamin.peterson python-checkins at python.org
Fri Jun 5 21:09:28 CEST 2009


Author: benjamin.peterson
Date: Fri Jun  5 21:09:28 2009
New Revision: 73250

Log:
only test for named pipe when os.stat doesn't raise #6209

Modified:
   python/trunk/Lib/shutil.py

Modified: python/trunk/Lib/shutil.py
==============================================================================
--- python/trunk/Lib/shutil.py	(original)
+++ python/trunk/Lib/shutil.py	Fri Jun  5 21:09:28 2009
@@ -58,9 +58,10 @@
         except OSError:
             # File most likely does not exist
             pass
-        # XXX What about other special files? (sockets, devices...)
-        if stat.S_ISFIFO(st.st_mode):
-            raise SpecialFileError("`%s` is a named pipe" % fn)
+        else:
+            # XXX What about other special files? (sockets, devices...)
+            if stat.S_ISFIFO(st.st_mode):
+                raise SpecialFileError("`%s` is a named pipe" % fn)
     try:
         fsrc = open(src, 'rb')
         fdst = open(dst, 'wb')


More information about the Python-checkins mailing list