Skip to content

Commit

Permalink
Also make ETag optional when file disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Argueta committed Nov 18, 2021
1 parent 0cf3545 commit 0390617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ def setxattr(self, copy_kwargs=None, **kwargs):
"""
if self.writable():
raise NotImplementedError(
"cannot update metadata while file " "is open for writing"
"cannot update metadata while file is open for writing"
)
return self.fs.setxattr(self.path, copy_kwargs=copy_kwargs, **kwargs)

Expand All @@ -1906,7 +1906,7 @@ def _fetch_range(self, start, end):
except OSError as ex:
if ex.args[0] == errno.EINVAL and "pre-conditions" in ex.args[1]:
raise FileExpired(
filename=self.details["name"], e_tag=self.details["ETag"]
filename=self.details["name"], e_tag=self.details.get("ETag")
) from ex
else:
raise
Expand Down

0 comments on commit 0390617

Please sign in to comment.