[Bug 1556927] Re: python3 builtin help() fails with exception
Serhiy Storchaka
1556927 at bugs.launchpad.net
Tue Oct 10 10:51:53 UTC 2017
This is fixed in version 3.4.4 in mainstream
(https://bugs.python.org/issue23898).
** Bug watch added: Python Roundup #23898
http://bugs.python.org/issue23898
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1556927
Title:
python3 builtin help() fails with exception
Status in python3-defaults package in Ubuntu:
New
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_bug.HelpBug) also fails with the exception, although
help(help_bug.RestrictedCompare) is successful.
This is a result of a comparison of objects that is not protected by
try ... except in the classify_class_attrs() function of the standard
inspect module. In particular, it is happening at the first
comparison of:
srch_obj == get_obj
when srch_obj is None.
The help(help_bug) and help(help_bug.HelpBug) calls successfully
display help documentation in Python 2.7.
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.4-minimal 3.4.3-1ubuntu~14.04.3
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1556927/+subscriptions
More information about the foundations-bugs
mailing list