python3 builtin help() fails with exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3-defaults (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The builtin help() function fails with an exception when called on a class that has a data attribute initialized to an object of a class which implements __eq__ in a manner that raises an exception when comparing to None.
The attached file, help_bug.py, is a module that illustrates the problem. In an interactive python3 session, importing the module as help_bug and then using the command:
help(help_bug)
will cause help to fail with a TypeError exception raised by the __eq__ method of the RestrictedCompare class before any help documentation is displayed.
In this example, it is the attribute named 'restricted' in the HelpBug class that is causing the problem, specifically its initialization to an object from the RestrictedCompare class. The command help(help_
This is a result of a comparison of objects that is not protected by try ... except in the classify_
srch_obj == get_obj
when srch_obj is None.
The help(help_bug) and help(help_
The output of lsb_release -rd is:
Description: Ubuntu 14.04.4 LTS
Release: 14.04
The package containing the inspect.py file is version libpython3.
tags: |
added: testcase trusty removed: exception help inspect python3 |
Changed in python3-defaults (Ubuntu): | |
importance: | Undecided → Medium |
This is fixed in version 3.4.4 in mainstream (https:/ /bugs.python. org/issue23898).