Skip to content

Commit 8bc0861

Browse files
committed
Fixing reproducibility command_line to add quotes when an arg includes whitespace
1 parent edf6934 commit 8bc0861

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tap/tap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from copy import deepcopy
44
import json
55
from pprint import pformat
6+
import re
67
import sys
78
import time
89
from warnings import warn
@@ -350,8 +351,9 @@ def get_reproducibility_info() -> Dict[str, str]:
350351
351352
:return: A dictionary of reproducibility information.
352353
"""
354+
args = [f"'{arg}'" if re.search(r'\s', arg) else arg for arg in sys.argv]
353355
reproducibility = {
354-
'command_line': f'python {" ".join(sys.argv)}',
356+
'command_line': f'python {" ".join(args)}',
355357
'time': time.strftime('%c')
356358
}
357359

0 commit comments

Comments
 (0)