mirror of
https://github.com/borgbackup/borg.git
synced 2026-02-20 00:10:35 -05:00
key export: fix crash when no path is given
In this case, the export functions output to stdout. Also: add a note why this code is needed.
This commit is contained in:
parent
6211a3dc79
commit
5eecdfa133
1 changed files with 3 additions and 1 deletions
|
|
@ -97,7 +97,9 @@ class KeysMixIn:
|
|||
manager.export_paperkey(args.path)
|
||||
else:
|
||||
try:
|
||||
if os.path.isdir(args.path):
|
||||
if args.path is not None and os.path.isdir(args.path):
|
||||
# on Windows, Python raises PermissionError instead of IsADirectoryError
|
||||
# (like on Unix) if the file to open is actually a directory.
|
||||
raise IsADirectoryError
|
||||
if args.qr:
|
||||
manager.export_qr(args.path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue