Closed heksesang closed 12 years ago
Possibly the lack of escaped backslashes could be explained by the use of non-posix shlex.split? As I don't think it handles escaping the same way in that mode?
name = remaining.popleft()
if not os.access(name, os.R_OK):
print('{0} {1}'.format(red('Invalid file:'), name))
Seems that name has ' at each side, messing up the os.access and os.path calls.
name = remaining.popleft()
name = name.replace("'", "")
if not os.access(name, os.R_OK):
print('{0} {1}'.format(red('Invalid file:'), name))
That should do the trick.
fixed per pull from heksesang
I keep getting "Invalid file" reported when running the script as a post-script of SABnzbd (with TV sorting disabled).
By the looks of it, SAB passes in the directory to the script, but the os.access fails even though I tested using os.access before the anidb.py script was run (did it from within the sabtoanidb.py script) and it returned true.
It might be because the argument passed in does not have escaped backslashes, and therefore it fails. I'm gonna test that later.
PS: This is on Windows 7 (x64).