lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
595 stars 66 forks source link

khard doesn't find vcf file #321

Closed robertwenner closed 1 year ago

robertwenner commented 1 year ago

I've installed khard from the Ubuntu repository and added a simple config file, but khard claims it cannot find the vcf file.

robert@perle:~$ khard list
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/khard/config.py", line 174, in init_address_books
    "tmp", [VdirAddressBook(name, section[name]['path'], **kwargs)
  File "/usr/lib/python3/dist-packages/khard/config.py", line 174, in <listcomp>
    "tmp", [VdirAddressBook(name, section[name]['path'], **kwargs)
  File "/usr/lib/python3/dist-packages/khard/address_book.py", line 168, in __init__
    raise FileNotFoundError("[Errno 2] The path {} to the address book"
FileNotFoundError: [Errno 2] The path /home/robert/leute/contacts-2023-01-18.vcf to the address book Robert does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/khard", line 33, in <module>
    sys.exit(load_entry_point('khard==0.17.0', 'console_scripts', 'khard')())
  File "/usr/lib/python3/dist-packages/khard/khard.py", line 1068, in main
    args, conf = cli.init(argv)
  File "/usr/lib/python3/dist-packages/khard/cli.py", line 521, in init
    return args, merge_args_into_config(args, conf)
  File "/usr/lib/python3/dist-packages/khard/cli.py", line 497, in merge_args_into_config
    config.init_address_books()
  File "/usr/lib/python3/dist-packages/khard/config.py", line 177, in init_address_books
    raise ConfigError(str(err))
khard.config.ConfigError: [Errno 2] The path /home/robert/leute/contacts-2023-01-18.vcf to the address book Robert does not exist.

But the file does exist and is readable:

robert@perle:~$ ls -l /home/robert/leute/contacts-2023-01-18.vcf
-rw-rw-r-- 1 robert robert 12M 2023-01-18 14:43 /home/robert/leute/contacts-2023-01-18.vcf

My simple config:

robert@perle:~$ cat ~/.config/khard/khard.conf
[addressbooks]
[[Robert]]
path=/home/robert/leute/contacts-2023-01-18.vcf

khard version:

robert@perle:~$ khard --version
Khard version 0.17.0

What am I missing here?

robertwenner commented 1 year ago

Never mind, just realized it expects a directory, not a file. Error message could be improved, though.