`python setup.py register` fails if long_description contains RST

Bug #905500 reported by anatoly techtonik
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python
Fix Released
Unknown
python2.7 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

In my setup.py long_description is read from external reStructuredText file:
    long_description=open('README.rst').read(),

And it gives a traceback when I try to register package on PyPI. See traceback.txt in attach.

Step to reproduce:
1. hg clone https://bitbucket.org/techtonik/python-pager; cd python-pager
2. hg up -r 24
3. python setup.py register

I presume that markup contains errors, but it should not fail with traceback.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: python2.7 2.7.2-5ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-11.50-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: i386
CheckboxSubmission: b346f016d264f3ef62407d5e29c198a2
CheckboxSystem: daed2f3d6643b4a84b4520a2427f8c2b
Date: Fri Dec 16 23:46:30 2011
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python2.7
UpgradeStatus: Upgraded to oneiric on 2011-10-02 (75 days ago)

Revision history for this message
anatoly techtonik (techtonik) wrote :
Revision history for this message
Jason Conti (jconti) wrote :

Looking at distutils/command/check.py , it subclasses Reporter from docutils/utils.py in python-doctutils to override the system_message method (I guess to stop it from writing output and raising exceptions). But the original system_message method returns a nodes.system_message object, which is used later in docutils/parsers/rst/states.py also in the python-docutils package, and fails because the value is None.

The system message that it is failing on (using https://bitbucket.org/techtonik/python-pager/raw/b8dba77eb4aa/README.rst ) is:

Unknown interpreted text role "func". (at debug level 3)

There is also a previous system message that makes it through before raising the TypeError (at debug level 1):

No role entry for "func" in module "docutils.parsers.rst.languages.en".
Trying "func" as canonical role name.

The fix may be as simple as appending:

return nodes.system_message(message, level=level, type=self.levels[level], *children, **kwargs)

to the system_message method in the SilentReporter class in distutils/command/check.py. This should probably be reported upstream (if it isn't already) so they can take a look at it and work out a proper fix.

Revision history for this message
anatoly techtonik (techtonik) wrote :

Thanks for the research. I've opened upstream issue at http://bugs.python.org/issue13614

Changed in python:
status: Unknown → New
Revision history for this message
Éric Araujo (merwok) wrote :

Thanks for the diagnosis; I will fix this upstream soon-ish.

Matthias Klose (doko)
Changed in python2.7 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in python:
status: New → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

fixed in 14.04 LTS and later releases

Changed in python2.7 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.