Skip to content

Commit 04c8a4d

Browse files
committed
Revert "Revert "Raise error when blf GzipFile is requested""
This reverts commit 4eaa7df.
1 parent 6ec7151 commit 04c8a4d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

can/io/blf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
of uncompressed data each. This data contains the actual CAN messages and other
1212
objects types.
1313
"""
14-
14+
import gzip
1515
import struct
1616
import zlib
1717
import datetime
@@ -395,6 +395,11 @@ def __init__(
395395
speed and compression (currently equivalent to level 6).
396396
"""
397397
mode = "rb+" if append else "wb"
398+
if type(file) == gzip.GzipFile:
399+
raise ValueError(
400+
f"The BLFWriter is currently incompatible with "
401+
f"{gzip.GzipFile.__name__}s. Try using a different zip format."
402+
)
398403
try:
399404
super().__init__(file, mode=mode)
400405
except FileNotFoundError:

0 commit comments

Comments
 (0)