Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure with empty vCard entry in file #9

Open
kkrugler opened this issue Apr 23, 2021 · 0 comments
Open

Failure with empty vCard entry in file #9

kkrugler opened this issue Apr 23, 2021 · 0 comments

Comments

@kkrugler
Copy link

When processing a large file (> 2000 entries), I got this error:

Traceback (most recent call last):
  File "vcardtools.py", line 281, in <module>
    main()
  File "vcardtools.py", line 214, in main
    args.no_remove_name_in_email \
  File "/Users/kenkrugler/git/vcardtools/vcardlib.py", line 810, in get_vcards_from_files
    selected_name = select_most_relevant_name(available_names)
  File "/Users/kenkrugler/git/vcardtools/vcardlib.py", line 374, in select_most_relevant_name
    raise ValueError("Trying to select a name from an empty list of names")
ValueError: Trying to select a name from an empty list of names

I added some debugging logging (would be useful to dump out card and count when an exception happens), and the vCard entry was <VCARD| [<VERSION{}3.0>, <PRODID{}-//Apple Inc.//macOS 11.2.3//EN>, <N{} >]>

I grepped the input file, and found it was this entry:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//macOS 11.2.3//EN
N:;;;;
END:VCARD

After removing it from the file, the code ran to completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant