Skip to content

Commit 2d75769

Browse files
tomvdwThe TensorFlow Datasets Authors
authored andcommitted
Create the subfolder if it doesn't exist when creating an incomplete file
PiperOrigin-RevId: 701935891
1 parent 340664b commit 2d75769

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tensorflow_datasets/core/utils/py_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ def incomplete_file(
334334
) -> Iterator[epath.Path]:
335335
"""Writes to path atomically, by writing to temp file and renaming it."""
336336
tmp_path = _tmp_file_name(path, subfolder=subfolder)
337+
tmp_path.parent.mkdir(exist_ok=True)
337338
try:
338339
yield tmp_path
339340
tmp_path.replace(path)

0 commit comments

Comments
 (0)