File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import base64
4- import io
54import os
65import platform
76import shutil
87import stat
9- import tarfile
108from pathlib import Path
119from urllib import request
1210
@@ -117,9 +115,10 @@ def setup_libmongocrypt():
117115 LOGGER .info (f"Fetching { url } ..." )
118116 with request .urlopen (request .Request (url ), timeout = 15.0 ) as response : # noqa: S310
119117 if response .status == 200 :
120- fileobj = io .BytesIO (response .read ())
121- with tarfile .open ("libmongocrypt.tar.gz" , fileobj = fileobj ) as fid :
122- fid .extractall (Path .cwd () / "libmongocrypt" )
118+ with Path ("libmongocrypt.tar.gz" ).open ("wb" ) as f :
119+ f .write (response .read ())
120+ Path ("libmongocrypt" ).mkdir ()
121+ run_command ("tar -xzf libmongocrypt.tar.gz -C libmongocrypt" )
123122 LOGGER .info (f"Fetching { url } ... done." )
124123
125124 run_command ("ls -la libmongocrypt" )
You can’t perform that action at this time.
0 commit comments