classification
Title: Pydoc3.2: TypeError: unorderable types
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Ramchandra Apte, lemburg, pitrou, python-dev, r.david.murray, threewestwinds, vstinner
Priority: normal Keywords:

Created on 2011-12-07 08:14 by threewestwinds, last changed 2011-12-15 20:44 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
DEBUG threewestwinds, 2011-12-07 08:14 value of "binary" that the regex is searching against
Messages (9)
msg148951 - (view) Author: Peter Frauenglass (threewestwinds) Date: 2011-12-07 08:14
While attempting to use pydoc, I came across the following error. On my system it's simple to reproduce: pydoc -p 1234, then visit http://localhost:1234/ in a browser.

A open('/home/(me)/DEBUG', 'w').write(binary)
 right before the m.groups() call created the attached file. Hopefully this is enough to help. Thanks.

~$ pydoc3.2 -p 1234 py/core.py 
Server ready at http://localhost:1234/
Server commands: [b]rowser, [q]uit
server> ----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49185)
Traceback (most recent call last):
  File "/usr/lib/python3.2/socketserver.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.2/socketserver.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.2/socketserver.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.2/socketserver.py", line 638, in __init__
    self.handle()
  File "/usr/lib/python3.2/http/server.py", line 399, in handle
    self.handle_one_request()
  File "/usr/lib/python3.2/http/server.py", line 387, in handle_one_request
    method()
  File "/usr/lib/python3.2/pydoc.py", line 2405, in do_GET
    self.path, content_type).encode('utf-8'))
  File "/usr/lib/python3.2/pydoc.py", line 2723, in _url_handler
    return get_html_page(url)
  File "/usr/lib/python3.2/pydoc.py", line 2713, in get_html_page
    return html.page(title, content)
  File "/usr/lib/python3.2/pydoc.py", line 2497, in page
    </body></html>''' % (title, css_link, html_navbar(), contents)
  File "/usr/lib/python3.2/pydoc.py", line 2530, in html_navbar
    """ % (version, html.escape(platform.platform(terse=True)))
  File "/usr/lib/python3.2/platform.py", line 1568, in platform
    libcname,libcversion = libc_ver(sys.executable)
  File "/usr/lib/python3.2/platform.py", line 184, in libc_ver
    if soversion > version:
TypeError: unorderable types: NoneType() > str()
----------------------------------------
msg148952 - (view) Author: Peter Frauenglass (threewestwinds) Date: 2011-12-07 08:22
I should also mention that pydoc2.7 -p 1234 works without issue. It seems to be a regression.

Also adding lemburg to the Nosy list as the comments on platform.py suggest.
msg148962 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-12-07 12:15
This seems to be an issue with the platform module's detection of the glibc. Can you tell us more about your system? (OS, distribution...)
msg148967 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2011-12-07 13:56
On my system it works. :-)
msg148968 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-07 14:16
Can you try to patch platform.py with the following patch?


diff --git a/Lib/platform.py b/Lib/platform.py
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -186,7 +186,7 @@ def libc_ver(executable=sys.executable,l
         elif so:
             if lib != 'glibc':
                 lib = 'libc'
-                if soversion > version:
+                if soversion and soversion > version:
                     version = soversion
                 if threads and version[-len(threads):] != threads:
                     version = version + threads
msg149002 - (view) Author: Peter Frauenglass (threewestwinds) Date: 2011-12-07 22:55
The patch in msg<148968> solves the issue for me.

I'm running Linux, originally installed as Mint 9, though upgraded and modified incrementally until it's now kubuntu 11.10. I have the "libc6" package version "2.13-20ubuntu5" installed.
msg149571 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-15 20:40
New changeset 5ec7ecf62c1d by Victor Stinner in branch '3.2':
Issue #13545: Fix platform.libc_version() is the SO version is missing
http://hg.python.org/cpython/rev/5ec7ecf62c1d

New changeset a9ee21ac0879 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #13545: Fix platform.libc_version() is the SO version is missing
http://hg.python.org/cpython/rev/a9ee21ac0879
msg149572 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-15 20:42
> The patch in msg<148968> solves the issue for me.

Cool, I applied the patch to Python 3.2 and 3.3.
msg149573 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-15 20:44
New changeset f2a5dcced66d by Victor Stinner in branch '2.7':
Issue #13545: Fix platform.libc_version() is the SO version is missing
http://hg.python.org/cpython/rev/f2a5dcced66d
History
Date User Action Args
2011-12-15 20:44:01python-devsetmessages: + msg149573
2011-12-15 20:42:30vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg149572
2011-12-15 20:40:40python-devsetnosy: + python-dev
messages: + msg149571
2011-12-07 22:55:51threewestwindssetmessages: + msg149002
2011-12-07 14:16:29vstinnersetnosy: + vstinner
messages: + msg148968
2011-12-07 13:56:43Ramchandra Aptesetnosy: + Ramchandra Apte
messages: + msg148967
2011-12-07 12:15:54pitrousetnosy: + r.david.murray, pitrou

messages: + msg148962
versions: + Python 3.3
2011-12-07 08:22:42threewestwindssetnosy: + lemburg
messages: + msg148952
2011-12-07 08:14:10threewestwindscreate