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

TypeError: iter() takes at most 1 positional argument (2 given) #147

Closed
gizmonerd opened this issue Dec 21, 2013 · 2 comments
Closed

TypeError: iter() takes at most 1 positional argument (2 given) #147

gizmonerd opened this issue Dec 21, 2013 · 2 comments

Comments

@gizmonerd
Copy link

vaultzero@Scanner:~/Desktop$ weasyprint http://weasyprint.org tmp/weasyprint-website.pdf
Traceback (most recent call last):
File "/usr/local/bin/weasyprint", line 9, in
load_entry_point('WeasyPrint==0.20.2', 'console_scripts', 'weasyprint')()
File "/usr/local/lib/python2.7/dist-packages/weasyprint/main.py", line 141, in main
getattr(html, 'write_' + format_)(output, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/init.py", line 160, in write_pdf
return self.render(stylesheets).write_pdf(target, zoom)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/init.py", line 132, in render
return Document._render(self, stylesheets, enable_hinting)
File "/usr/local/lib/python2.7/dist-packages/weasyprint/document.py", line 301, in _render
for css in stylesheets or []])
File "/usr/local/lib/python2.7/dist-packages/weasyprint/css/init.py", line 446, in get_all_computed_styles
element_tree, device_media_type, url_fetcher))
File "/usr/local/lib/python2.7/dist-packages/weasyprint/css/init.py", line 169, in find_stylesheets
for element in element_tree.iter('style', 'link'):
File "lxml.etree.pyx", line 1350, in lxml.etree._Element.iter (src/lxml/lxml.etree.c:40720)
TypeError: iter() takes at most 1 positional argument (2 given)

@SimonSapin
Copy link
Member

Hi @gizmonerd . What version of lxml are you using? You may need 3.0 or more recent. Try import lxml.etree; print(lxml.etree.LXML_VERSION)

@gizmonerd
Copy link
Author

Thanks!

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