Skip to content

Commit

Permalink
Add some error ignoring for copystat call in move()
Browse files Browse the repository at this point in the history
  • Loading branch information
aereaux committed Dec 20, 2024
1 parent f622bd8 commit 34af24b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions beets/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,13 @@ def move(path: bytes, dest: bytes, replace: bool = False):
finally:
tmp.close()

# Copy file metadata
shutil.copystat(syspath(path), tmp.name)
try:
# Copy file metadata
shutil.copystat(syspath(path), tmp.name)
except OSError:
# Ignore errors because it doesn't matter too much. We may be on a
# filesystem that doesn't support this.
pass

# Move the copied file into place.
try:
Expand Down

0 comments on commit 34af24b

Please sign in to comment.