Skip to content

Commit 115f3de

Browse files
committed
Fix _default_name for compressed files
1 parent 2da28c1 commit 115f3de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

can/io/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,11 @@ def _default_name(self) -> StringPathLike:
345345
"""Generate the default rotation filename."""
346346
path = pathlib.Path(self.base_filename)
347347
new_name = (
348-
path.stem
348+
path.parts[-1].split(".")[0]
349349
+ "_"
350350
+ datetime.now().strftime("%Y-%m-%dT%H%M%S")
351351
+ "_"
352352
+ f"#{self.rollover_count:03}"
353-
+ path.suffix
353+
+ "".join(pathlib.Path(self.base_filename).suffixes[-2:])
354354
)
355355
return str(path.parent / new_name)

0 commit comments

Comments
 (0)