Skip to content

Commit 2164542

Browse files
authored
Merge pull request AnswerDotAI#632 from fastai/path-minor
add Path to `untar` dest
2 parents cc75f59 + c7a75f8 commit 2164542

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

fastcore/xtras.py

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def _unpack(fname, out):
171171
def untar_dir(fname, dest, rename=False, overwrite=False):
172172
"untar `file` into `dest`, creating a directory if the root contains more than one item"
173173
import tempfile,shutil
174+
dest = Path(dest)
174175
with tempfile.TemporaryDirectory() as d:
175176
out = Path(d)/remove_suffix(Path(fname).stem, '.tar')
176177
out.mkdir()

nbs/03_xtras.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@
536536
"def untar_dir(fname, dest, rename=False, overwrite=False):\n",
537537
" \"untar `file` into `dest`, creating a directory if the root contains more than one item\"\n",
538538
" import tempfile,shutil\n",
539+
" dest = Path(dest)\n",
539540
" with tempfile.TemporaryDirectory() as d:\n",
540541
" out = Path(d)/remove_suffix(Path(fname).stem, '.tar')\n",
541542
" out.mkdir()\n",

0 commit comments

Comments
 (0)