uota
uota copied to clipboard
Fix ValueError with latest MP
I seem to be having problem with the latest version of MP throwing a ValueError when untaring files.
Traceback (most recent call last):
File "main.py", line 30, in <module>
File "uota.py", line 185, in install_new_firmware
File "tarfile/__init__.py", line 129, in __next__
File "tarfile/__init__.py", line 107, in next
OSError: [Errno 22] EINVAL
I haven't been able to determine the exact cause but it seems to work fine when using the 'with' keyword on the deflate.
with deflate.DeflateIO(f1, deflate.GZIP) as f2
instead of
f2 = deflate.DeflateIO(f1, deflate.GZIP)