File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -148,10 +148,13 @@ def loads_multi(s:str):
148148 s = s [pos :]
149149
150150# Cell
151- def untar_dir (file , dest ):
151+ def untar_dir (fname , dest ):
152+ "untar `file` into `dest`"
152153 with tempfile .TemporaryDirectory (dir = '.' ) as d :
153154 d = Path (d )
154- with tarfile .open (mode = 'r:gz' , fileobj = file ) as t : t .extractall (d )
155+ with open (fname , 'rb' ) as f :
156+ with tarfile .open (mode = 'r:gz' , fileobj = f ) as t :
157+ t .extractall (d )
155158 next (d .iterdir ()).rename (dest )
156159
157160# Cell
Original file line number Diff line number Diff line change 10071007 "outputs" : [],
10081008 "source" : [
10091009 " #export\n " ,
1010- " def untar_dir(file, dest):\n " ,
1010+ " def untar_dir(fname, dest):\n " ,
1011+ " \" untar `file` into `dest`\"\n " ,
10111012 " with tempfile.TemporaryDirectory(dir='.') as d:\n " ,
10121013 " d = Path(d)\n " ,
1013- " with tarfile.open(mode='r:gz', fileobj=file) as t: t.extractall(d)\n " ,
1014+ " with open(fname, 'rb') as f:\n " ,
1015+ " with tarfile.open(mode='r:gz', fileobj=f) as t:\n " ,
1016+ " t.extractall(d)\n " ,
10141017 " next(d.iterdir()).rename(dest)"
10151018 ]
10161019 },
20672070 " Converted 05_transform.ipynb.\n " ,
20682071 " Converted 07_meta.ipynb.\n " ,
20692072 " Converted 08_script.ipynb.\n " ,
2070- " Converted index.ipynb.\n "
2073+ " Converted index.ipynb.\n " ,
2074+ " Converted parallel_win.ipynb.\n "
20712075 ]
20722076 }
20732077 ],
You can’t perform that action at this time.
0 commit comments