Skip to content

Commit f739bcc

Browse files
Add gzip check to compress method (#1429)
* Add gzip check to compress method Addresses @zariiii9003 from #1385 (comment) * Update can/io/logger.py Co-authored-by: zariiii9003 <[email protected]> * Update logger.py Co-authored-by: zariiii9003 <[email protected]>
1 parent 5f485db commit f739bcc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

can/io/logger.py

+4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ def compress(
105105
File will automatically recompress upon close.
106106
"""
107107
real_suffix = pathlib.Path(filename).suffixes[-2].lower()
108+
if real_suffix in (".blf", ".db"):
109+
raise ValueError(
110+
f"The file type {real_suffix} is currently incompatible with gzip."
111+
)
108112
if kwargs.get("append", False):
109113
mode = "ab" if real_suffix == ".blf" else "at"
110114
else:

0 commit comments

Comments
 (0)