[issue35614] Broken help() on metaclasses

2018-12-30 Thread Nick Coghlan


Change by Nick Coghlan :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-30 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset b539cef31c060c7eecc331d25a23b80ded0baf08 by Nick Coghlan (Sanyam 
Khurana) in branch 'master':
bpo-35614: Fix pydoc help() on metaclasses (#11357)
https://github.com/python/cpython/commit/b539cef31c060c7eecc331d25a23b80ded0baf08


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
keywords: +patch, patch, patch
pull_requests: +10670, 10671, 10672
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
keywords: +patch
pull_requests: +10670
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Sanyam Khurana


Change by Sanyam Khurana :


--
keywords: +patch, patch
pull_requests: +10670, 10671
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are two ways of solving this issue: 1) skip this chunk of code if object 
is a type subclass, 2) use `type.__subclasses__(object)` instead of 
`object.__subclasses__()`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It fails also for builtin "type".

$ ./python -m pydoc type
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2765, in 
cli()
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2727, in cli
help.help(arg)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1967, in help
elif request: doc(request, 'Help on %s:', output=self._output)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1690, in doc
pager(render_doc(thing, title, forceload))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1683, in render_doc
return title % desc + '\n\n' + renderer.document(object, name)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 386, in document
if inspect.isclass(object): return self.docclass(*args)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1258, in docclass
(str(cls.__name__) for cls in object.__subclasses__()
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35614] Broken help() on metaclasses

2018-12-29 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

$ ./python -m pydoc abc
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2765, in 
cli()
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2727, in cli
help.help(arg)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1967, in help
elif request: doc(request, 'Help on %s:', output=self._output)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1690, in doc
pager(render_doc(thing, title, forceload))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1683, in render_doc
return title % desc + '\n\n' + renderer.document(object, name)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 385, in document
if inspect.ismodule(object): return self.docmodule(*args)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1182, in docmodule
contents.append(self.document(value, key, name))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 386, in document
if inspect.isclass(object): return self.docclass(*args)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1258, in docclass
(str(cls.__name__) for cls in object.__subclasses__()
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

$ ./python -m pydoc enum
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2765, in 
cli()
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 2727, in cli
help.help(arg)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1967, in help
elif request: doc(request, 'Help on %s:', output=self._output)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1690, in doc
pager(render_doc(thing, title, forceload))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1683, in render_doc
return title % desc + '\n\n' + renderer.document(object, name)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 385, in document
if inspect.ismodule(object): return self.docmodule(*args)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1182, in docmodule
contents.append(self.document(value, key, name))
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 386, in document
if inspect.isclass(object): return self.docclass(*args)
  File "/home/serhiy/py/cpython/Lib/pydoc.py", line 1258, in docclass
(str(cls.__name__) for cls in object.__subclasses__()
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

"object" is a metaclass (abc.ABCMeta or enum.EnumMeta) in tracebacks above.

The regression was introduced in issue8525.

--
components: Library (Lib)
messages: 332720
nosy: CuriousLearner, belopolsky, eric.araujo, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Broken help() on metaclasses
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com