mirror of
https://github.com/frida/releng.git
synced 2026-11-07 09:36:02 -10:00
post-process-oabi: Flush tempfile before using it
The NamedTemporaryFile is buffered by default, so there might be data left in the buffer when shutil.copyfileobj() completes. This would then result in TarFile.extractall() failing due to trying to read from an incomplete archive.
This commit is contained in:
1 parent
aa3ea2ba93
commit
2470ad11f3
1 file changed
+1
@@ -35,6 +35,7 @@ def main():
|
||||
with urllib.request.urlopen(arm64e_sdk_url) as response, \
|
||||
tempfile.NamedTemporaryFile(suffix=".tar.xz") as archive:
|
||||
shutil.copyfileobj(response, archive)
|
||||
archive.flush()
|
||||
arm64e_artifact_path = Path(archive.name)
|
||||
|
||||
with tempfile.TemporaryDirectory() as patched_artifact_dir:
|
||||
|
||||
Reference in new issue
Block a user