File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ Directory and files operations
47
47
0, only the contents from the current file position to the end of the file will
48
48
be copied.
49
49
50
+ :func: `copyfileobj ` will *not * guarantee that the destination stream has
51
+ been flushed on completion of the copy. If you want to read from the
52
+ destination at the completion of the copy operation (for example, reading
53
+ the contents of a temporary file that has been copied from a HTTP stream),
54
+ you must ensure that you have called :func: `~io.IOBase.flush ` or
55
+ :func: `~io.IOBase.close ` on the file-like object before attempting to read
56
+ the destination file.
50
57
51
58
.. function :: copyfile(src, dst, *, follow_symlinks=True)
52
59
Original file line number Diff line number Diff line change @@ -167,11 +167,12 @@ def make_build_python(context, working_dir):
167
167
@subdir (HOST_BUILD_DIR , clean_ok = True )
168
168
def make_emscripten_libffi (context , working_dir ):
169
169
shutil .rmtree (working_dir / "libffi-3.4.6" , ignore_errors = True )
170
- with tempfile .NamedTemporaryFile (suffix = ".tar.gz" ) as tmp_file :
170
+ with tempfile .NamedTemporaryFile (suffix = ".tar.gz" , delete_on_close = False ) as tmp_file :
171
171
with urlopen (
172
172
"https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz"
173
173
) as response :
174
174
shutil .copyfileobj (response , tmp_file )
175
+ tmp_file .close ()
175
176
shutil .unpack_archive (tmp_file .name , working_dir )
176
177
call (
177
178
[EMSCRIPTEN_DIR / "make_libffi.sh" ],
You can’t perform that action at this time.
0 commit comments