Skip to content

Commit 467390f

Browse files
mhtrinhLICahsan-z-khanshreyapandit
authored
fix: Deference symbolic link when create tar file (#2338)
Dereference all symbolic link when packing source code and dependencies. Symbolic link will unlikely have any meaning once deployed in the Docker instance. Co-authored-by: Ahsan Khan <[email protected]> Co-authored-by: Shreya Pandit <[email protected]>
1 parent 0eaa7c0 commit 467390f

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)