This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Pydoc3.2: TypeError: unorderable types
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3
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 2022-04-11 14:57 by admin. This issue is now closed.

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/ 
Server ready at http://localhost:1234/
Server commands: [b]rowser, [q]uit
server> ----------------------------------------
Exception happened during processing of request from ('', 49185)
Traceback (most recent call last):
  File "/usr/lib/python3.2/", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.2/", line 310, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.2/", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.2/", line 638, in __init__
  File "/usr/lib/python3.2/http/", line 399, in handle
  File "/usr/lib/python3.2/http/", line 387, in handle_one_request
  File "/usr/lib/python3.2/", line 2405, in do_GET
    self.path, content_type).encode('utf-8'))
  File "/usr/lib/python3.2/", line 2723, in _url_handler
    return get_html_page(url)
  File "/usr/lib/python3.2/", line 2713, in get_html_page
    return, content)
  File "/usr/lib/python3.2/", line 2497, in page
    </body></html>''' % (title, css_link, html_navbar(), contents)
  File "/usr/lib/python3.2/", line 2530, in html_navbar
    """ % (version, html.escape(platform.platform(terse=True)))
  File "/usr/lib/python3.2/", line 1568, in platform
    libcname,libcversion = libc_ver(sys.executable)
  File "/usr/lib/python3.2/", 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 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 with the following patch?

diff --git a/Lib/ b/Lib/
--- a/Lib/
+++ b/Lib/
@@ -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

New changeset a9ee21ac0879 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #13545: Fix platform.libc_version() is the SO version is missing
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
Date User Action Args
2022-04-11 14:57:24adminsetgithub: 57754
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