database/__init__ error

Issue #134 closed
Former user created an issue

System: Python 3.7.4 (Win 10)

#!

pybtex/pybtex/database/__init__.py:172  (first line of add_entries())

seems wrong to me. The dict should be iterated by

for key, entry in entries.items():

for Python 3. The current syntax is giving me an

#!

too many values to unpack

in some derived software (https://github.com/johanvergeer/pelican-cite) at this location.

Sorry for the formatting of this post. Linking to source is horrible solved on bitbucket.

Comments (3)

  1. traits

    (I'm the OP)

    Or is add_entries expecting an iterator? Something like: bib1.add_entries(iter(bib0.entries.items())) (then, it works). BTW , it should be documented in any case. It is used in 3rd-party projects as public interface.

  2. Matthias Troffaes

    Yes, it’s expecting an iterator (at least judging from how it is used elsewhere in the library). I think we can document this with some type annotations (I have a PR ready).

  3. Log in to comment