Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion loguru/_file_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ def compression(path_in, ext, compress_function):
renamed_path = generate_rename_path(root, ext_before + ext, creation_time)
os.rename(path_out, renamed_path)
compress_function(path_in, path_out)
os.remove(path_in)
if os.path.exists(path_in):
# In some cases when we write logs to directory mounted with
# FUSE device using OSS (or AWS S3) + Fluid, here we may encounter:
# OSError: [Errno 34] Numerical result out of range,
# but the log file is removed successfully actually
try:
os.remove(path_in)
except OSError:
pass


class Retention:
Expand Down
Loading