Skip to content

Commit fee89c6

Browse files
committed
DOP-3078: expand tildes in paths input on the command line
1 parent 7863121 commit fee89c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snooty/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def main() -> None:
373373
rstspec_bytes = HTTPCache.singleton().get(args["--rstspec"])
374374
rstspec_text = str(rstspec_bytes, "utf-8")
375375
else:
376-
rstspec_text = Path(rstspec_path).read_text(encoding="utf-8")
376+
rstspec_text = Path(rstspec_path).expanduser().read_text(encoding="utf-8")
377377
specparser.Spec.initialize(rstspec_text)
378378

379379
if PARANOID_MODE:
@@ -392,7 +392,7 @@ def main() -> None:
392392
connection = pymongo.MongoClient(url, password=getpass.getpass())
393393
backend: Backend = MongoBackend(connection)
394394
elif output_path:
395-
zf = zipfile.ZipFile(output_path, mode="w")
395+
zf = zipfile.ZipFile(os.path.expanduser(output_path), mode="w")
396396
backend = ZipBackend(zf)
397397
else:
398398
backend = Backend()

0 commit comments

Comments
 (0)