Skip to content

Commit e192ee5

Browse files
committed
Set preserve_spaces to True in calls to safe_path # 27
Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent d5e5f93 commit e192ee5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/extractcode/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def extract(location, target_dir):
5454

5555
# make the path safe to use as a subfile path
5656
# ensure this a good and clean posix relative path
57-
patch_subfile_path = paths.safe_path(patch_subfile_path)
57+
patch_subfile_path = paths.safe_path(patch_subfile_path, preserve_spaces=True)
5858

5959
# create directories
6060
parent_dir = posixpath.dirname(patch_subfile_path)

src/extractcode/sevenzip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def extract_file_by_file(
467467
errors[entry.path] = 'No file name extracted.'
468468
continue
469469

470-
safe_path = paths.safe_path(entry.path, posix=True)
470+
safe_path = paths.safe_path(entry.path, posix=True, preserve_spaces=True)
471471
target_file_loc = os.path.join(target_dir, safe_path)
472472
target_file_dir = os.path.dirname(target_file_loc)
473473
fileutils.create_dir(target_file_dir)

0 commit comments

Comments
 (0)