Skip to content

Commit ea666ba

Browse files
authored
Deference symbolic link when create tar file
Dereference all symbolic link when packing source code and dependencies. Symbolic link will unlikely have any meaning once deployed in the Docker instance.
1 parent e43fa6d commit ea666ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sagemaker/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def create_tar_file(source_files, target=None):
331331
else:
332332
_, filename = tempfile.mkstemp()
333333

334-
with tarfile.open(filename, mode="w:gz") as t:
334+
with tarfile.open(filename, mode="w:gz", dereference=True) as t:
335335
for sf in source_files:
336336
# Add all files from the directory into the root of the directory structure of the tar
337337
t.add(sf, arcname=os.path.basename(sf))

0 commit comments

Comments
 (0)