Title: pydoc does not support non-ascii docstrings
Type: behavior Stage:
Components: Library (Lib), Unicode Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: UnicodeEncodeError on pydoc's CLI
View: 6625
Assigned To: Nosy List: flox, torsten
Priority: normal Keywords:

Created on 2010-06-14 09:13 by torsten, last changed 2010-11-02 19:58 by torsten. This issue is now closed.

File name Uploaded Description Edit torsten, 2010-06-14 09:13 Trivial source code with non-ascii docstring
Messages (4)
msg107774 - (view) Author: Torsten Landschoff (torsten) * Date: 2010-06-14 09:13
With the attached file I see the following behaviour:

torsten@ddhp3:~$ pydoc doc
Traceback (most recent call last):
  File "/usr/bin/pydoc", line 5, in <module>
  File "/usr/lib/python2.6/", line 2309, in cli
  File "/usr/lib/python2.6/", line 1773, in help
    elif request: doc(request, 'Help on %s:')
  File "/usr/lib/python2.6/", line 1516, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib/python2.6/", line 1323, in pager
  File "/usr/lib/python2.6/", line 1343, in <lambda>
    return lambda text: pipepager(text, 'less')
  File "/usr/lib/python2.6/", line 1364, in pipepager
UnicodeEncodeError: 'ascii' codec can't encode characters in position 184-186: ordinal not in range(128)

With the terminal on sys.stdout I get "UTF-8" as the encoding (sys.stdout.encoding), therefore I would expect this to work. It would be helpful to have an option to set the encoding when running pydoc as well.

And, of course, accessing the documentation via a web browser (pydoc -p 8000, firefox http://localhost:8000) I get a blank screen for the example. And a backtrace on the terminal where I started pydoc.
msg112374 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-08-01 19:41
A duplicate of #7675?
msg112375 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-08-01 19:42
Oops, I really mean #6625.
msg120252 - (view) Author: Torsten Landschoff (torsten) * Date: 2010-11-02 19:58
You are right, this is a duplicate of #6625. And in fact I should have known since I commented on that bug...
Date User Action Args
2010-11-02 19:58:10torstensetstatus: open -> closed

messages: + msg120252
2010-08-01 19:42:07floxsetstatus: pending -> open
superseder: help() doesn't accept unicode literals in built in docstrings -> UnicodeEncodeError on pydoc's CLI
messages: + msg112375
2010-08-01 19:41:31floxsetstatus: open -> pending

nosy: + flox
messages: + msg112374

superseder: help() doesn't accept unicode literals in built in docstrings
resolution: duplicate
2010-08-01 15:50:18belopolskysetcomponents: + Library (Lib)
2010-06-14 09:13:54torstencreate