Fixing an issue which strips all read bits from utorrent downloaded files on Linux

This commit is contained in:
rbfblk
2013-10-16 22:17:17 +02:00
committed by mano3m
parent 25f0462c15
commit b1e66478f0
@@ -182,7 +182,9 @@ class uTorrent(Downloader):
if folder and os.path.isdir(folder):
for root, folders, filenames in os.walk(folder):
for filename in filenames:
os.chmod(os.path.join(root, filename), stat.S_IWRITE)
filepath = os.path.join(root, filename)
#Windows only needs S_IWRITE, but we bitwise-or with current perms to preserve other permission bits on Linux
os.chmod(filepath, stat.S_IWRITE | os.stat(filepath).st_mode)
class uTorrentAPI(object):