diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-03-07 03:39:08 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-03-07 03:39:08 +0100 |
commit | c4f3a79f8ce19eab13ea7e53ff7a58fad43c6698 (patch) | |
tree | ba11d56c824f47bd49f386098d2c7f9df6019170 /module/plugins/hooks/AntiVirus.py | |
parent | New addon: AntiVirus (diff) | |
download | pyload-c4f3a79f8ce19eab13ea7e53ff7a58fad43c6698.tar.xz |
[AntiVirus] Fix quarantine file moving
Diffstat (limited to 'module/plugins/hooks/AntiVirus.py')
-rw-r--r-- | module/plugins/hooks/AntiVirus.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 4bb2396d9..c5d6b8321 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import os +import shutil import subprocess from module.plugins.Hook import Hook, Expose, threaded @@ -10,7 +11,7 @@ from module.utils import fs_encode, save_join class AntiVirus(Hook): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), ("quarpath" , "folder" , "Quarantine folder" , "" ), @@ -62,9 +63,9 @@ class AntiVirus(Hook): elif action == "Quarantine": new_filename = save_join(self.getConfig('quarpath'), name) - os.rename(filename, new_filename) + shutil.move(filename, new_filename) - except IOError, e: + except (IOError, shutil.Error), e: self.logError(name, action + " action failed!", e) elif not out: |