Bug 1292126 - Traceback when trying to view documentation
Traceback when trying to view documentation
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-pyudev (Show other bugs)
7.2
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Jaroslav Škarvada
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-16 09:35 EST by Branislav Náter
Modified: 2015-12-16 19:00 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-16 10:22:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Branislav Náter 2015-12-16 09:35:28 EST
Description of problem:
Traceback when trying to view documentation using pydoc.

Version-Release number of selected component (if applicable):
python-pyudev-0.15-7.el7

How reproducible:
always

Steps to Reproduce:
1. pydoc pyudev

Actual results:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site.py", line 459, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/lib64/python2.7/pydoc.py", line 1745, in __call__
    self.help(request)
  File "/usr/lib64/python2.7/pydoc.py", line 1792, in help
    else: doc(request, 'Help on %s:')
  File "/usr/lib64/python2.7/pydoc.py", line 1529, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib64/python2.7/pydoc.py", line 1334, in pager
    pager(text)
  File "/usr/lib64/python2.7/pydoc.py", line 1354, in <lambda>
    return lambda text: pipepager(text, 'less')
  File "/usr/lib64/python2.7/pydoc.py", line 1375, in pipepager
    pipe.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 9159: ordinal not in range(128)

Expected results:
Documentation displayed
Comment 2 mulhern 2015-12-16 10:22:28 EST
This is essentially a pydoc error, see: https://bugs.python.org/issue1065986.

It was fixed in some version of python between 2.7.5, where the problem still appears, and 2.7.10, where it does not seem to be present. It is also fixed in python v 3.0.
Comment 3 mulhern 2015-12-16 10:58:24 EST
Note: You might be wondering why pyudev is triggering this bug, when many other packages do not. The reason is that the developer of pyudev chose to import unicode_literals from __future__ in every file. This means that all literal strings are automatically unicode, including docstrings.

And, btw, I have found the offending ASCII '-'s, and changed them to ','s (https://github.com/mulkieran/pyudev/commit/46ae2eb0d966aea40ddd0e66f3fdf71e3b12b34a). This means that pyudev should no longer trigger this bug in the next version (0.19).

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