summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index e819b0a..4c24146 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -1577,7 +1577,11 @@ class FileIO(RawIOBase):
# For consistent behaviour, we explicitly seek to the
# end of file (otherwise, it might be done only on the
# first write()).
- os.lseek(fd, 0, SEEK_END)
+ try:
+ os.lseek(fd, 0, SEEK_END)
+ except OSError as e:
+ if e.errno != errno.ESPIPE:
+ raise
except:
if owned_fd is not None:
os.close(owned_fd)