summaryrefslogtreecommitdiff
path: root/fs/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'fs/base.py')
-rw-r--r--fs/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/base.py b/fs/base.py
index b91fe04..7ca15bf 100644
--- a/fs/base.py
+++ b/fs/base.py
@@ -971,6 +971,9 @@ class FS(object):
try:
src_file = self.open(src, "rb")
self.setcontents(dst, src_file, chunk_size=chunk_size)
+ except ResourceNotFoundError:
+ if self.exists(src) and not self.exists(dirname(dst)):
+ raise ParentDirectoryMissingError(dst)
finally:
if src_file is not None:
src_file.close()