debian: python: fix caching issue with shutil.copyfileobj()

shutil.copyfileobj() does not guarantee to flush the data to the dest file obj (see [1] and [2]. this behavior has been revealed by a recent change [3] on the copefileobj() buffer size in Python 3.14.

this behavior causes the tests to fail because recently we add a new function (shell.p:init_shell_entry()) to add a new boot entry for the tests (see [4]).

In Ubuntu, we are transitioning to Python 3.14 and this makes the tests fail on EDK2 build. This will also happen in Debian once it moves Python 3.14.

This commit makes sure we flush the data after the copefileobj calls.

[1] https://github.com/python/cpython/issues/135648 [2] https://github.com/python/cpython/commit/34393cbdd46fd965de86f1e7bc89ab111f506723 [3] https://github.com/python/cpython/commit/6efd95c4650ec7c2fb5522b352c74a9d44370fe0 [4] b5a8cf7d

Merge request reports

Loading