texworld / betterbib

:green_book: Command-line tools for bibliographies.
816 stars 42 forks source link

4.1.2 breaks entries with no journal #236

Closed anntzer closed 2 years ago

anntzer commented 2 years ago
$ betterbib aj - <<EOF
@phdthesis{phdthesis,
  author       = {My Name}, 
  title        = {The title of the work},
  school       = {The school of the thesis},
  year         = 1900,
  address      = {The address of the publisher},
  month        = 1,
  note         = {An optional note}
}
EOF

This used to just reformat the thing, but now raises

  File "/usr/bin/betterbib", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/betterbib/cli/_main.py", line 67, in main
    return args.func(args)
  File "/usr/lib/python3.10/site-packages/betterbib/cli/_journal_abbrev.py", line 11, in run
    d = journal_abbrev(d, args.long_journal_names, args.extra_abbrev_file)
  File "/usr/lib/python3.10/site-packages/betterbib/journal_abbrev.py", line 29, in journal_abbrev
    journal = value.fields["journal"]
  File "/usr/lib/python3.10/site-packages/pybtex/utils.py", line 163, in __getitem__
    return self._dict[key.lower()]
KeyError: 'journal'