Skip to content

Commit 44386ef

Browse files
chmreidhannes-ucsc
authored andcommitted
remove EACCES, improve explanatory comments
1 parent b27f702 commit 44386ef

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

hca/dss/util/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ def hardlink(source, link_name):
5858
if source_stat.st_dev != dest_stat.st_dev or source_stat.st_ino != dest_stat.st_ino:
5959
raise
6060
except OSError as e:
61-
copy_on_error = [
62-
errno.EMLINK, # too many links
63-
errno.EACCES, # permission denied
64-
errno.EPERM, # operation not permitted
65-
]
61+
# ELINK can occur when max number of links has been reached
62+
# EPERM can occur when writing to NFS
63+
copy_on_error = (errno.EMLINK, errno.EPERM)
6664
if e.errno in copy_on_error:
6765
# FIXME: Copying is not space efficient; see https://github.com/HumanCellAtlas/dcp-cli/issues/453
6866
log.warning('Failed to link source `%s` to destination `%s`; reverting to copying', source, link_name)

0 commit comments

Comments
 (0)