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

get_metadata throws AssertionError : assert isinstance(key, str) #47

Closed
daamien opened this issue Jan 6, 2017 · 3 comments
Closed

get_metadata throws AssertionError : assert isinstance(key, str) #47

daamien opened this issue Jan 6, 2017 · 3 comments

Comments

@daamien
Copy link

daamien commented Jan 6, 2017

Hello,

Thanks for this piece of software, it's pretty cool but I'm struggling with the metadata function :

from panflute import *
meta = {'author': MetaString('John Doe')}
content = [Header(Str('Title')), Para(Str('Hello!'))]
doc = Doc(*content, metadata=meta, format='pdf')
a=doc.get_metadata('author')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/panflute/tools.py", line 239, in _get_metadata
    assert isinstance(key, str)
AssertionError

Am I doing something wrong ?

@sergiocorreia
Copy link
Owner

This is probably a Python2-related bug; will try to push a bug fix later

sergiocorreia added a commit that referenced this issue Jan 6, 2017
@sergiocorreia
Copy link
Owner

Latest commit is passing but I don't have a py2 machine right now to test this personally. Let me know if the bug is still present on the latest version.

Note: don't install the github version, as only versions from pypi support py2

@daamien
Copy link
Author

daamien commented Jan 6, 2017

FIXED

Bravo :-)

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

2 participants