Bug 849744 - ftbfs caused by python-docutils update
Summary: ftbfs caused by python-docutils update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-docutils
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Toshio Ernie Kuratomi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-20 18:15 UTC by Mads Kiilerich
Modified: 2012-09-17 22:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-17 22:59:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Mads Kiilerich 2012-08-20 18:15:35 UTC
Mercurial fails to build with python-docutils-0.10-0.2.20120730svn7490.fc18.noarch :

make -C doc
make[1]: Entering directory `/home/dev/rpmbuild/BUILD/mercurial-2.2.3/doc'
python runrst hgmanpage  --halt warning \
  --strip-elements-with-class htmlonly hgrc.5.txt hgrc.5
Traceback (most recent call last):
  File "runrst", line 50, in <module>
    publish_cmdline(writer_name=writer)
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 349, in publish_cmdline
    pub.set_components(reader_name, parser_name, writer_name)
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 99, in set_components
    self.set_writer(writer_name)
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 88, in set_writer
    writer_class = writers.get_writer_class(writer_name)
  File "/usr/lib/python2.7/site-packages/docutils/writers/__init__.py", line 136, in get_writer_class
    module = __import__(writer_name, globals(), locals(), level=1)
ImportError: No module named hgmanpage

It builds without problems when downgrading to python-docutils-0.8.1-3.fc17.noarch .

Comment 1 Toshio Ernie Kuratomi 2012-08-20 18:45:33 UTC
First look seems like a change in behaviour in docutils that would need a change in mercurial.  the hgmanpage module is located in mercurial's doc directory.  I bet that docutils used to somehow pick up on its presence there but now we need to set the PYTHONPATH or something to find it.

Comment 2 Toshio Ernie Kuratomi 2012-08-20 18:48:14 UTC
I notice that the master branch in git has mercurial-2.3.  Is it fine to look at that one?  (The issue is still occurring there and if I fix it there it'll be generalizable back to 2.2.3?)

Comment 3 Mads Kiilerich 2012-08-20 19:04:43 UTC
(In reply to comment #1)
> I bet that docutils used to somehow pick up on its presence
> there but now we need to set the PYTHONPATH or something to find it.

Hacking docutils so prints sys.path before the import shows that the doc folder is in the import path.

An explicit 'import hgmanpage' works. __import__ with level=-1 also works (for this import but fails for other imports).

(In reply to comment #2)

I don't think anything relevant changed in Mercurial, but testing with the version that worked in f17 takes one variable out of the equation.


I would expect that the docutils library was stable and didn't require changes in the code that use docutils. Using an unreleased svn snapshot will of course increase the risk of introducing a regression ... but also make it possible to fix it before the real release.

Comment 4 Toshio Ernie Kuratomi 2012-08-20 19:14:23 UTC
Here's the change in docutils that's causing this:

http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/writers/__init__.py?r1=7317&r2=7486

and the referenced bug report:

https://sourceforge.net/tracker/?func=detail&aid=3541369&group_id=38414&atid=422030

Unfortunately, docutils doesn't guarantee a stable API between releases.

I'm going to open this issue on the upstream bug tracker to see if it's intended behaviour or if they'd be willing to work out a different fix but I think this might be an intended change in behaviour as it brings the python2 and python3 behaviour in line with each other.

Comment 5 Toshio Ernie Kuratomi 2012-08-20 19:15:58 UTC
Note that Fedora 18 is going to ship with python3-3.3 so we'll have to pick up some change along these lines from upstream to support that python3 version.

Comment 6 Mads Kiilerich 2012-08-20 19:26:15 UTC
I thought the idea of py3 was to introduce non-backward compatible changes that couldn't be introduced in py2. 

If level=1 is needed for py3.3 then it should be used where it is necessary or do no harm. But to introduce a py2 regression when making it py3.3 compatible seems strange.

Comment 7 Toshio Ernie Kuratomi 2012-08-20 20:49:42 UTC
That's up to each individual upstream that's porting their library to python3.  python3 itself allowed the python upstream to introduce a large number of incompatible changes but that doesn't affect what individual libraries built on top of python do.

Testing the code a bit more, this isn't just a behaviour change, though.  The new code doesn't seem to have any way to load user-created writers (and probably readers and other things as well).  Fortunately, there's a simple fix for this if that is the case.

Comment 8 Toshio Ernie Kuratomi 2012-08-20 21:09:24 UTC
https://sourceforge.net/tracker/?func=detail&aid=3559988&group_id=38414&atid=422030

We're also waiting on dmalcolm or upstream to port this package to python3.3 before it will pass its own ftbfs.  I'll check with him to see if he has an update on that.

Comment 9 Fedora Update System 2012-08-24 17:59:53 UTC
python-docutils-0.10-0.5.20120824svn7502.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-docutils-0.10-0.5.20120824svn7502.fc18

Comment 10 Toshio Ernie Kuratomi 2012-08-24 18:03:20 UTC
This should fix it for you.  On Rawhide, you should just be able to build.  On F18 you'll need to create a buildroot override in bodhi until the update goes to stable.  I'll probably make another package update later today because there's other places in the docutils code besides writers() that's affected by this change to __import__().  It shouldn't affect you unless you're also using a custom reader, parser, directives, or languages modules, though.

Let me know if there's any difficulties.

Comment 11 Fedora Update System 2012-08-24 21:34:03 UTC
Package python-docutils-0.10-0.5.20120824svn7502.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-docutils-0.10-0.5.20120824svn7502.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12655/python-docutils-0.10-0.5.20120824svn7502.fc18
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2012-08-25 15:19:31 UTC
python-docutils-0.10-0.6.20120824svn7502.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-docutils-0.10-0.6.20120824svn7502.fc18

Comment 13 Fedora Update System 2012-09-17 22:59:28 UTC
python-docutils-0.10-0.6.20120824svn7502.fc18 has been pushed to the Fedora 18 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.