Skip to content

Commit 13abfbd

Browse files
committed
Use plain path and support ERROR in stderr/stdout
7zip can now also have ERROR-prefixed messages in stderr/stdout Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent d542cc5 commit 13abfbd

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/extractcode/sevenzip.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
import io
3131
import logging
3232
import os
33-
import posixpath
3433
import pprint
3534
import re
36-
from re import MULTILINE # NOQA
3735

3836
import attr
3937

@@ -96,8 +94,9 @@ def get_7z_errors(stdout, stderr):
9694
# FIXME: we should use only one pass over stdout for errors and warnings
9795
if not stdout or not stdout.strip():
9896
return
99-
100-
find_7z_errors = re.compile('^Error:(.*)$', MULTILINE | re.DOTALL).findall
97+
98+
# ERROR: Can not create symbolic link : A required privilege is not held by the client. : .\2-SYMTYPE
99+
find_7z_errors = re.compile('^Error:(.*)$', re.MULTILINE | re.DOTALL | re.IGNORECASE).findall
101100

102101
stdlow = stderr.lower()
103102
for err, msg in sevenzip_errors:
@@ -360,7 +359,7 @@ def extract_file_by_file(location, target_dir, arch_type='*', log=on_mac, skip_s
360359
else:
361360
raise Exception(ent.to_dict())
362361

363-
parent, filename = posixpath.split(pth)
362+
parent, filename = os.path.split(pth)
364363
filenames_by_parent_dir[parent].append(filename)
365364

366365
need_by_file = any(

0 commit comments

Comments
 (0)