Kaydet (Commit) a663a373 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

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

üst d53d085a
...@@ -58,9 +58,10 @@ def copyfile(src, dst): ...@@ -58,9 +58,10 @@ def copyfile(src, dst):
except OSError: except OSError:
# File most likely does not exist # File most likely does not exist
pass pass
# XXX What about other special files? (sockets, devices...) else:
if stat.S_ISFIFO(st.st_mode): # XXX What about other special files? (sockets, devices...)
raise SpecialFileError("`%s` is a named pipe" % fn) if stat.S_ISFIFO(st.st_mode):
raise SpecialFileError("`%s` is a named pipe" % fn)
try: try:
fsrc = open(src, 'rb') fsrc = open(src, 'rb')
fdst = open(dst, 'wb') fdst = open(dst, 'wb')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment