Skip to content

Commit 3d9405b

Browse files
committed
debug log when fail mkdir
1 parent 1d3ba8c commit 3d9405b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: sdks/python/apache_beam/io/fileio.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,11 @@ def process(self, element, w=beam.DoFn.WindowParam):
710710

711711
try:
712712
filesystems.FileSystems.mkdirs(self.path.get())
713-
except IOError:
714-
# Directory already exists.
715-
pass
713+
except IOError as e:
714+
cause = repr(e)
715+
if 'FileExistsError' not in cause:
716+
# Usually harmless. Especially if see FileExistsError so no need to log
717+
_LOGGER.debug('Fail to create dir for final destination: %s', cause)
716718

717719
try:
718720
filesystems.FileSystems.rename(

0 commit comments

Comments
 (0)