Hide Forgot
abrt version: 2.0.1 architecture: i686 cmdline: /usr/bin/python /usr/bin/rst2pdf foo.txt component: rst2pdf executable: /usr/bin/rst2pdf kernel: 2.6.38.6-27.fc15.i686 os_release: Fedora release 15 (Lovelock) package: rst2pdf-0.16-2.fc15 reason: createpdf.py:169:__init__:TypeError: get_language() takes exactly 2 arguments (1 given) time: Mon May 30 19:18:09 2011 uid: 500 username: maxx backtrace: :createpdf.py:169:__init__:TypeError: get_language() takes exactly 2 arguments (1 given) : :Traceback (most recent call last): : File "/usr/bin/rst2pdf", line 9, in <module> : load_entry_point('rst2pdf==0.16', 'console_scripts', 'rst2pdf')() : File "/usr/lib/python2.7/site-packages/rst2pdf/createpdf.py", line 1452, in main : numbered_links=options.numbered_links, : File "/usr/lib/python2.7/site-packages/rst2pdf/createpdf.py", line 169, in __init__ : get_language (self.language) :TypeError: get_language() takes exactly 2 arguments (1 given) : :Local variables in innermost frame: :footnote_backlinks: True :smarty: '0' :inline_footnotes: False :inlinelinks: False :style_path: [] :numbered_links: False :breakside: 'any' :blank_first_page: False :self: <rst2pdf.createpdf.RstToPdf object at 0x9b6d94c> :basedir: '/home/maxx' :header: None :show_frame: False :floating_images: False :background_fit_mode: 'center' :def_dpi: 300 :real_footnotes: False :repeat_table_rows: False :baseurl: 'file:///home/maxx/' :stylesheets: [] :font_path: [] :highlightlang: 'python' :splittables: True :custom_cover: 'cover.tmpl' :sphinx: False :language: 'en' :footer: None :fit_mode: 'shrink' :breaklevel: 0 comment: :Create a text file and attempt to run rst2pdf on it. : :The error "TypeError: get_language() takes exactly 2 arguments (1 given)" is thrown and rst2pdf does not create a pdf file.
The problem is an API change in python docutils docutils 0.7 -> get_language(language_code) docutils 0.8 -> get_language(language_code, reporter) I will report upstream
Upstream bug http://code.google.com/p/rst2pdf/issues/detail?id=401
rst2pdf-0.16-3.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/rst2pdf-0.16-3.fc15
rst2pdf-0.16-3.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
I've just upgraded to 0.16-3 and throw a similar issue on pdfbuilder.py file. Just replacing all get_language(sthing) with get_language(sthing, None) sems to do the trick - for my needs at least.
(In reply to comment #5) > I've just upgraded to 0.16-3 and throw a similar issue on pdfbuilder.py file. > Just replacing all get_language(sthing) with get_language(sthing, None) sems to > do the trick - for my needs at least. Weird, 0.16-3 works for me. Could you post the rpm version?
Wait, it does work :) I mean, I get not error when i run: from rst2pdf.createpdf import RstToPdf rst2pdf = RstToPdf() I get this error using rst2pdf from sphinx (some doc for my job); and I do not know how to reproduce it from the rst2psf api. You solved a problem in createpdf.py, the one I have is on pdfbuilder.py; but the point is still the docutils api change. Btw, here's the version I use: % rpm -q rst2pdf rst2pdf-0.16-3.fc15.noarch
rst2pdf-0.16-4.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/rst2pdf-0.16-4.fc15
Package rst2pdf-0.16-4.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing rst2pdf-0.16-4.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/rst2pdf-0.16-4.fc15 then log in and leave karma (feedback).
(In reply to comment #9) > Package rst2pdf-0.16-4.fc15: > * should fix your issue, > * was pushed to the Fedora 15 testing repository, > * should be available at your local mirror within two days. > Update it with: > # su -c 'yum update --enablerepo=updates-testing rst2pdf-0.16-4.fc15' > as soon as you are able to. > Please go to the following url: > https://admin.fedoraproject.org/updates/rst2pdf-0.16-4.fc15 > then log in and leave karma (feedback). Tryed but still not works (same error) %rpm -s rst2pdf rst2pdf-0.16-4.fc15.noarch
Could you post the stack trace? I don't know from which call the error comes.
rst2pdf-0.16-4.fc15 does fix the issue I've reported ; I've got no error on my side at the moment.
Hope this is what you're waiting for : % rst2pdf cv.rst createpdf.py:169:__init__:TypeError: get_language() takes exactly 1 argument (2 given) Traceback (most recent call last): File "/usr/bin/rst2pdf", line 9, in <module> load_entry_point('rst2pdf==0.16', 'console_scripts', 'rst2pdf')() File "/usr/lib/python2.7/site-packages/rst2pdf/createpdf.py", line 1452, in main numbered_links=options.numbered_links, File "/usr/lib/python2.7/site-packages/rst2pdf/createpdf.py", line 169, in __init__ get_language (self.language, None) TypeError: get_language() takes exactly 1 argument (2 given) Local variables in innermost frame: footnote_backlinks: True smarty: '0' inline_footnotes: False inlinelinks: False style_path: [] numbered_links: False breakside: 'any' blank_first_page: False self: <rst2pdf.createpdf.RstToPdf object at 0x94eb5ec> basedir: '/home/damien/Projets/pelican-martin-damien.fr/src' header: None show_frame: False floating_images: False background_fit_mode: 'center' def_dpi: 300 real_footnotes: False repeat_table_rows: False baseurl: 'file:///home/damien/Projets/pelican-martin-damien.fr/src/' stylesheets: [] font_path: [] highlightlang: 'python' splittables: True custom_cover: 'cover.tmpl' sphinx: False language: 'en' footer: None fit_mode: 'shrink' breaklevel: 0
This is strange, because in this function call, my version has 2 arguments and it works. What is your version of docutils?
% rpm -q python-docutils python-docutils-0.8-0.1.20110517svn7036.fc15.noarch
I can't reproduce your problem. Please try by removing rst2pdf and docutils and reinstalling again. Perphaps you have a different docutils 0.7 package installed somewhere in your system (such as ~/.local/lib/python2.7/site-packages/)
rst2pdf-0.16-4.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.