`python setup.py register` fails if long_description contains RST
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_
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:/
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
ProcVersionSign
Uname: Linux 2.6.38-11-generic i686
NonfreeKernelMo
ApportVersion: 1.23-0ubuntu4
Architecture: i386
CheckboxSubmission: b346f016d264f3e
CheckboxSystem: daed2f3d6643b4a
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)
Changed in python: | |
status: | Unknown → New |
Changed in python2.7 (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in python: | |
status: | New → Fix Released |
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.