issue #226: don't attempt to fchmod() a pathname

This commit is contained in:
David Wilson 2018-04-28 21:56:23 +01:00
parent 58d8f60f57
commit 780b63520f
1 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ def transfer_file(context, in_path, out_path, sync=False, set_owner=False):
try:
try:
os.fchmod(tmp_path, metadata['mode'])
os.fchmod(fp.fileno(), metadata['mode'])
if set_owner:
set_fd_owner(fp.fileno(), metadata['owner'], metadata['group'])
@ -447,7 +447,7 @@ def write_path(path, s, owner=None, group=None, mode=None,
try:
try:
if mode:
os.fchmod(tmp_path, mode)
os.fchmod(fp.fileno(), mode)
if owner or group:
set_fd_owner(fp.fileno(), owner, group)
fp.write(s)