aboutsummaryrefslogtreecommitdiff
path: root/scripts/python_qmp_updater.py
diff options
context:
space:
mode:
authorNir Soffer <nirsof@gmail.com>2025-02-28 21:57:08 +0200
committerEric Blake <eblake@redhat.com>2025-03-04 16:41:17 -0600
commitd0f439ddd37e1354daca3234976295189985cb04 (patch)
tree6493f6fe822d4f91660c038e5b79c8d116070070 /scripts/python_qmp_updater.py
parent661c2e1ab29cd9c4d268ae3f44712e8d421c0e56 (diff)
downloadqemu-d0f439ddd37e1354daca3234976295189985cb04.zip
qemu-d0f439ddd37e1354daca3234976295189985cb04.tar.gz
qemu-d0f439ddd37e1354daca3234976295189985cb04.tar.bz2
iotest: Unbreak 302 with python 3.13
This test depends on TarFile.addfile() to add tar member header without writing the member data, which we write ourself using qemu-nbd. Python 3.13 changed the function in a backward incompatible way[1] to require a file object for tarinfo with non-zero size, breaking the test: -[{"name": "vm.ovf", "offset": 512, "size": 6}, {"name": "disk", "offset": 1536, "size": 393216}] +Traceback (most recent call last): + File "/home/stefanha/qemu/tests/qemu-iotests/302", line 118, in <module> + tar.addfile(disk) + ~~~~~~~~~~~^^^^^^ + File "/usr/lib64/python3.13/tarfile.py", line 2262, in addfile + raise ValueError("fileobj not provided for non zero-size regular file") +ValueError: fileobj not provided for non zero-size regular file The new behavior makes sense for most users, but breaks our unusual usage. Fix the test to add the member header directly using public but undocumented attributes. This is more fragile but the test works again. This also fixes a bug in the previous code - when calling addfile() without a fileobject, tar.offset points to the start of the member data instead of the end. [1] https://github.com/python/cpython/pull/117988 Signed-off-by: Nir Soffer <nirsof@gmail.com> Message-ID: <20250228195708.48035-1-nirsof@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/python_qmp_updater.py')
0 files changed, 0 insertions, 0 deletions