|
@@ -97,11 +97,21 @@ if __name__ == "__main__":
|
|
|
if not local_filename.parent.exists():
|
|
|
local_filename.parent.mkdir()
|
|
|
|
|
|
- if local_filename.exists():
|
|
|
-
|
|
|
- if Path(local_filename).stat().st_size in error_file_sizes:
|
|
|
-
|
|
|
- os.remove(local_filename)
|
|
|
+ try:
|
|
|
+ if local_filename.exists():
|
|
|
+
|
|
|
+ if Path(local_filename).stat().st_size in error_file_sizes:
|
|
|
+
|
|
|
+ os.remove(local_filename)
|
|
|
+ except OSError as ex:
|
|
|
+ if ex.errno == 36:
|
|
|
+ print(
|
|
|
+ f"Filename is too long: "
|
|
|
+ f"{local_filename.relative_to(root_path)}. "
|
|
|
+ f" Message: {ex}"
|
|
|
+ )
|
|
|
+ else:
|
|
|
+ raise
|
|
|
|
|
|
|
|
|
if (not local_filename.exists()) and (not local_filename.is_symlink()):
|