Skip to content

Commit 69e0efc

Browse files
committed
fix tarfile edgecase in python3.14
1 parent d2692f0 commit 69e0efc

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

sigmf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: LGPL-3.0-or-later
66

77
# version of this python module
8-
__version__ = "1.6.0"
8+
__version__ = "1.6.1"
99
# matching version of the SigMF specification
1010
__specification__ = "1.2.6"
1111

tests/test_archive.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ def test_fileobj_ignores_extension(self):
6969

7070
def test_custom_name_overrides_fileobj_name(self):
7171
"""Test that name is used in file object"""
72-
with open(self.temp_path_archive, "wb") as temp:
73-
sigmf_archive = self.sigmf_object.archive(name="testarchive", fileobj=temp)
74-
sigmf_tarfile = tarfile.open(sigmf_archive, mode="r")
72+
with open(self.temp_path_archive, "w+b") as temp:
73+
self.sigmf_object.archive(name="testarchive", fileobj=temp)
74+
temp.seek(0) # rewind to beginning of file after writing
75+
sigmf_tarfile = tarfile.open(fileobj=temp, mode="r")
7576
basedir, file1, file2 = sigmf_tarfile.getmembers()
7677
self.assertEqual(basedir.name, "testarchive")
7778
self.assertEqual(Path(file1.name).stem, "testarchive")

0 commit comments

Comments
 (0)