Skip to content

Commit

Permalink
scim: fix "Bad file descriptor" error from double-opened fd gc
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-fg committed Jan 31, 2025
1 parent 75e2bd2 commit dcaf168
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scim
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,7 @@ def link_file_type( p,

def link_copy(src, dst, meta=False, root=None, **repl_kws):
'Copy src to dst with all metadata (if requested), in a reasonably atomic way'
with open_read_fd(src, root) as a_fd:
a = open(a_fd, 'rb')
with open_read_fd(src, root) as a_fd, open(a_fd, 'rb') as a:
kws = dict() if not meta else dict(
mode=stat.S_IMODE((st := os.stat(a_fd)).st_mode),
uidgid=(st.st_uid, st.st_gid),
Expand Down

0 comments on commit dcaf168

Please sign in to comment.