Bug 447779 - "pydoc turbogears" doesn't work
Summary: "pydoc turbogears" doesn't work
Status: CLOSED DUPLICATE of bug 461419
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 11
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-05-21 18:48 UTC by Nils Philippsen
Modified: 2009-12-02 20:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-12-02 20:53:18 UTC
Type: ---

Attachments (Terms of Use)
"tg_doc" -- pydoc wrapper/replacement that works with turbogears (127 bytes, text/plain)
2008-05-21 19:06 UTC, Nils Philippsen
no flags Details

Description Nils Philippsen 2008-05-21 18:48:40 UTC
Description of problem:
nils@gibraltar:~> pydoc turbogears
problem in turbogears - <class 'pkg_resources.VersionConflict'>: (CherryPy 3.0.3
(/usr/lib/python2.5/site-packages), Requirement.parse('CherryPy<3.0'))

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. "pydoc turbogears" or any component thereunder
Actual results:
See above

Expected results:
Docs are shown

Additional info:
This might need the pkg_resources/requires dance in all turbogears modules (just
a WAG).

Comment 1 Nils Philippsen 2008-05-21 19:06:19 UTC
Created attachment 306305 [details]
"tg_doc" -- pydoc wrapper/replacement that works with turbogears

A small wrapper/replacement which uses pkg_resources to setup TurboGears for
inclusion by pydoc.

Comment 2 Toshio Ernie Kuratomi 2008-05-21 19:24:20 UTC
Yep, that'll work.  So the question is, what's the bug?  If we ship a tg_doc
wrapper, that let's the user get to the turbogears documentation from the
command line but it doesn't help the user who already knows about pydoc
turbogears to discover the new command.  OTOH, this might be the best we can do
short of porting pydoc to know about eggs (which it has its own special problems
since the egg name and the module import name are seldom the same.)

If we ship this, tg-pydoc seems like a better name.

We could also look into integrating this with tg-admin.  tg-admin doc
turbogears; tg-admin doc fas; for instance.

Comment 3 Nils Philippsen 2008-05-21 21:27:01 UTC
That script was only meant as a proof-of-concept -- I wasn't suggesting to
replace pydoc, but to fix TG for it. The real fix has to be done in the TG
modules (i.e. copy the 2 requirement lines or something along that line).

Comment 4 Toshio Ernie Kuratomi 2008-05-21 22:17:16 UTC
That won't work.  By the time you've imported TurboGeats, it's already too late
to specify __requires__.

Comment 5 Toshio Ernie Kuratomi 2008-05-21 22:17:29 UTC
That won't work.  By the time you've imported TurboGears, it's already too late
to specify __requires__.

Comment 6 Nils Philippsen 2008-05-23 17:06:04 UTC
(In reply to comment #5)
> That won't work.  By the time you've imported TurboGears, it's already too late
> to specify __requires__.

I could be wrong, but wouldn't it be sufficient if TG used __requires__ etc. for
importing the correct cherrypy version to make pydoc work again?

Comment 7 Toshio Ernie Kuratomi 2008-05-23 21:18:39 UTC
In my testing yesterday it failed when I added the __requires__ line to

To be a bit more thorough I just did this:

yum install -y python-cherrypy python-cherrypy2 turbogears

sudo sed -i "s/import pkg_resources/__requires__='CherryPy < 3.0'\nimport
pkg_resources\nimport cherrypy\nprint cherrypy.__version__\n/"

pydoc turbogears

problem in turbogears - <class 'pkg_resources.VersionConflict'>: (CherryPy 3.0.3
(/usr/lib/python2.5/site-packages), Requirement.parse('CherryPy<3.0'))

So that seems to confirm that setting __requires__ after turbogears has been
imported will be too late.

Comment 8 Nils Philippsen 2008-05-26 09:57:57 UTC
Hmm, it seems to me that this has to be solved in pydoc, therefore I'll change
the component to python. I'm not privy to how pydoc works in detail, but it
seems to be unaware of the egg concept, importing the wrong (new) cherrypy
version which makes importing turbogears fail. Despite that, if one module
throws errors when imported, "pydoc -k" etc. don't work (see bug #246212).

Comment 9 Nils Philippsen 2008-05-26 09:58:34 UTC
Argh. Changing assignee as well.

Comment 10 Nils Philippsen 2008-05-26 09:59:28 UTC
I seem to have a knot in my fingers. One more attempt to change the component.

Comment 11 Nils Philippsen 2008-05-26 10:00:03 UTC
I seem to have a knot in my fingers. One more attempt to change the component.

Comment 12 Bug Zapper 2009-06-10 01:04:08 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 13 Dave Malcolm 2009-12-02 20:53:18 UTC

*** This bug has been marked as a duplicate of bug 461419 ***

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