We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ec7151 commit 04c8a4dCopy full SHA for 04c8a4d
can/io/blf.py
@@ -11,7 +11,7 @@
11
of uncompressed data each. This data contains the actual CAN messages and other
12
objects types.
13
"""
14
-
+import gzip
15
import struct
16
import zlib
17
import datetime
@@ -395,6 +395,11 @@ def __init__(
395
speed and compression (currently equivalent to level 6).
396
397
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
+ )
403
try:
404
super().__init__(file, mode=mode)
405
except FileNotFoundError:
0 commit comments