Browse Source

Only shorten pathname on Windows for par2

Otherwise unicode paths are misformed and not detected. This is also how we do it for unrar.
tags/1.1.1RC3
Safihre 9 years ago
committed by shypike
parent
commit
f18ec189b8
  1. 9
      sabnzbd/newsunpack.py

9
sabnzbd/newsunpack.py

@ -1063,16 +1063,17 @@ def par2_repair(parfile_nzf, nzo, workdir, setname, single):
assert isinstance(nzo, sabnzbd.nzbstuff.NzbObject) assert isinstance(nzo, sabnzbd.nzbstuff.NzbObject)
# Check if file exists, otherwise see if another is done # Check if file exists, otherwise see if another is done
parfile = os.path.join(workdir, parfile_nzf.filename) parfile_path = os.path.join(workdir, parfile_nzf.filename)
if not os.path.exists(parfile) and parfile_nzf.extrapars: if not os.path.exists(parfile_path) and parfile_nzf.extrapars:
for new_par in parfile_nzf.extrapars: for new_par in parfile_nzf.extrapars:
test_parfile = os.path.join(workdir, new_par.filename) test_parfile = os.path.join(workdir, new_par.filename)
if os.path.exists(test_parfile): if os.path.exists(test_parfile):
parfile = test_parfile parfile_nzf = new_par
break break
parfile = short_path(parfile) # Shorten just the workdir on Windows
workdir = short_path(workdir) workdir = short_path(workdir)
parfile = os.path.join(workdir, parfile_nzf.filename)
old_dir_content = os.listdir(workdir) old_dir_content = os.listdir(workdir)
used_joinables = () used_joinables = ()

Loading…
Cancel
Save