Bug 709119 - rst2pdf-0.16-2.fc15 doesn't work with docutils 0.8
Summary: rst2pdf-0.16-2.fc15 doesn't work with docutils 0.8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rst2pdf
Version: 15
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Pascual
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:39881528fe4f4a975c2a12a34c5...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-30 17:19 UTC by Mads Villadsen
Modified: 2011-06-24 17:52 UTC (History)
3 users (show)

Fixed In Version: rst2pdf-0.16-4.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-24 17:52:29 UTC
Type: ---


Attachments (Terms of Use)

Description Mads Villadsen 2011-05-30 17:19:58 UTC
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.

Comment 1 Sergio Pascual 2011-05-31 09:47:19 UTC
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

Comment 2 Sergio Pascual 2011-05-31 09:49:23 UTC
Upstream bug

http://code.google.com/p/rst2pdf/issues/detail?id=401

Comment 3 Fedora Update System 2011-05-31 11:26:57 UTC
rst2pdf-0.16-3.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/rst2pdf-0.16-3.fc15

Comment 4 Fedora Update System 2011-06-07 04:36:51 UTC
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.

Comment 5 Johan Cwiklinski 2011-06-07 08:44:18 UTC
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.

Comment 6 Sergio Pascual 2011-06-07 18:54:07 UTC
(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?

Comment 7 Johan Cwiklinski 2011-06-07 20:31:32 UTC
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

Comment 8 Fedora Update System 2011-06-08 10:23:41 UTC
rst2pdf-0.16-4.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/rst2pdf-0.16-4.fc15

Comment 9 Fedora Update System 2011-06-10 13:34:40 UTC
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).

Comment 10 MARTIN Damien 2011-06-15 08:45:39 UTC
(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

Comment 11 Sergio Pascual 2011-06-16 09:14:53 UTC
Could you post the stack trace? I don't know from which call the error comes.

Comment 12 Johan Cwiklinski 2011-06-16 09:23:42 UTC
rst2pdf-0.16-4.fc15 does fix the issue I've reported ; I've got no error on my side at the moment.

Comment 13 MARTIN Damien 2011-06-16 09:27:17 UTC
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

Comment 14 Sergio Pascual 2011-06-16 10:57:58 UTC
This is strange, because in this function call, my version has 2 arguments and
it works. What is your version of docutils?

Comment 15 MARTIN Damien 2011-06-16 11:08:26 UTC
% rpm -q python-docutils
python-docutils-0.8-0.1.20110517svn7036.fc15.noarch

Comment 16 Sergio Pascual 2011-06-20 22:19:37 UTC
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/)

Comment 17 Fedora Update System 2011-06-24 17:52:24 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.