[issue46353] 'pydoc -k' fails when some module's loader is not found

2022-01-12 Thread Denis Laxalde


Change by Denis Laxalde :


--
keywords: +patch
pull_requests: +28758
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30557

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



[issue46353] 'pydoc -k' crashes when some module's loader is not found

2022-01-12 Thread Denis Laxalde


New submission from Denis Laxalde :

On my (Debian 10) system, 'pydoc -k' crashes as follows:
  

$ python3 -m pydoc -k foo
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
  File "/usr/lib/python3.9/pydoc.py", line 2862, in 
cli()
  File "/usr/lib/python3.9/pydoc.py", line 2795, in cli
apropos(val)
  File "/usr/lib/python3.9/pydoc.py", line 2287, in apropos
ModuleScanner().run(callback, key, onerror=onerror)
  File "/usr/lib/python3.9/pydoc.py", line 2248, in run
loader = spec.loader
AttributeError: 'NoneType' object has no attribute 'loader'

(The same happens with current 'main' of CPython.)

The module that is tried to be loaded is 'ansible.galaxy.data', installed in 
/usr/lib/python3/dist-packages/ and it uses a custom (Ansible) finder 
_AnsiblePathHookFinder.

Maybe this finder has problems, but since Finder.find_module() may return None, 
I believe this should be handled by pydoc's ModuleScanner.

If agreed, I'll prepare a fix accordingly.

--
components: Library (Lib)
messages: 410388
nosy: dlax
priority: normal
severity: normal
status: open
title: 'pydoc -k' crashes when some module's loader is not found
type: crash
versions: Python 3.9

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



[issue44564] DeprecationWarning in test_enum over formatting

2021-07-29 Thread Denis Laxalde


Denis Laxalde  added the comment:

The assertion at stake looks redundant since we already check that 
`'{}'.format(OkayEnum.one) == '1'` (the line above) and that `OkayEnum.one == 
'1'` (3 lines above).

--
nosy: +dlax

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



[issue42414] unable to document fields of dataclass

2021-07-22 Thread Denis Laxalde


Change by Denis Laxalde :


--
nosy: +dlax

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



[issue44353] PEP 604 NewType

2021-07-21 Thread Denis Laxalde


Change by Denis Laxalde :


--
nosy: +dlax

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