--- /usr/lib/python2.5/pydoc.py 2009-02-17 22:43:25.000000000 +0100 +++ /home/christoph/dokumente/projekte/cjklib/trunk/pydoc.py 2009-08-02 14:55:35.000000000 +0200 @@ -52,7 +52,7 @@ # the current directory is changed with os.chdir(), an incorrect # path will be displayed. -import sys, imp, os, re, types, inspect, __builtin__, pkgutil +import sys, imp, os, re, types, inspect, __builtin__, pkgutil, locale from repr import Repr from string import expandtabs, find, join, lower, split, strip, rfind, rstrip try: @@ -1337,8 +1337,11 @@ def pipepager(text, cmd): """Page through text by feeding it to another program.""" pipe = os.popen(cmd, 'w') + output_encoding = (hasattr(sys.stdout, 'encoding') \ + and sys.stdout.encoding) or locale.getpreferredencoding() \ + or 'ascii' try: - pipe.write(text) + pipe.write(text.encode(output_encoding)) pipe.close() except IOError: pass # Ignore broken pipes caused by quitting the pager program.