Skip to content

Commit 25644c3

Browse files
committed
Merge branch 'master' of github.com:swansonk14/typed-argument-parser
2 parents f03681e + 8e29d9d commit 25644c3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tap/tap.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from functools import partial
55
import json
66
from pprint import pformat
7-
import re
7+
from shlex import quote
88
import sys
99
import time
10-
from warnings import warn
1110
from types import MethodType
1211
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, TypeVar, Union, get_type_hints
1312
from typing_inspect import is_literal_type, get_args
13+
from warnings import warn
1414

1515
from tap.utils import (
1616
get_class_variables,
@@ -352,9 +352,8 @@ def get_reproducibility_info() -> Dict[str, str]:
352352
353353
:return: A dictionary of reproducibility information.
354354
"""
355-
args = [f"'{arg}'" if re.search(r'\s', arg) else arg for arg in sys.argv]
356355
reproducibility = {
357-
'command_line': f'python {" ".join(args)}',
356+
'command_line': f'python {" ".join(quote(arg) for arg in sys.argv)}',
358357
'time': time.strftime('%c')
359358
}
360359

0 commit comments

Comments
 (0)