Skip to content

Commit 3cadb7f

Browse files
cyfracopybara-github
authored andcommitted
Adding more debug information in file extraction.
PiperOrigin-RevId: 275897552
1 parent a54f109 commit 3cadb7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tensorflow_datasets/core/download/extractor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ def _sync_extract(self, from_path, method, to_path):
8585
"""Returns `to_path` once resource has been extracted there."""
8686
to_path_tmp = '%s%s_%s' % (to_path, constants.INCOMPLETE_SUFFIX,
8787
uuid.uuid4().hex)
88+
path = None
8889
try:
8990
for path, handle in iter_archive(from_path, method):
9091
path = tf.compat.as_text(path)
9192
_copy(handle, path and os.path.join(to_path_tmp, path) or to_path_tmp)
9293
except BaseException as err:
93-
msg = 'Error while extracting %s to %s : %s' % (from_path, to_path, err)
94+
msg = 'Error while extracting %s to %s (file: %s) : %s' % (
95+
from_path, to_path, path, err)
9496
raise ExtractError(msg)
9597
# `tf.io.gfile.Rename(overwrite=True)` doesn't work for non empty
9698
# directories, so delete destination first, if it already exists.

0 commit comments

Comments
 (0)