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
4747 0, only the contents from the current file position to the end of the file will
4848 be copied.
4949
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.
5057
5158.. function :: copyfile(src, dst, *, follow_symlinks=True)
5259
Original file line number Diff line number Diff line change @@ -167,11 +167,12 @@ def make_build_python(context, working_dir):
167167@subdir (HOST_BUILD_DIR , clean_ok = True )
168168def make_emscripten_libffi (context , working_dir ):
169169 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 :
171171 with urlopen (
172172 "https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz"
173173 ) as response :
174174 shutil .copyfileobj (response , tmp_file )
175+ tmp_file .close ()
175176 shutil .unpack_archive (tmp_file .name , working_dir )
176177 call (
177178 [EMSCRIPTEN_DIR / "make_libffi.sh" ],
You can’t perform that action at this time.
0 commit comments