[issue22543] -W option cannot use non-standard categories

Feng Yu report at bugs.python.org
Sat Jan 4 20:28:16 EST 2020


Feng Yu <rainwoodman at gmail.com> added the comment:

Coming here from https://github.com/astropy/astropy/issues/9832#issuecomment-570751353

Importing the named module during warning initialization is somewhat like code injection. And it may introduce unintended side-effects -- for example if this causes some 3rd party libraries to initialize too early?

String matching on the class name of every class in the hierarchy is safer, as there is no 'expected' code execution.

----------
nosy: +Feng Yu

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22543>
_______________________________________


More information about the Python-bugs-list mailing list