[issue30592] Bad error message 'bool()() takes no keyword arguments'

STINNER Victor report at bugs.python.org
Thu Jun 8 08:44:26 EDT 2017


STINNER Victor added the comment:

> If add an assertion, the user code could provoke a crash by creating an exception type with a name containing "()": type('E()', (BaseException,), {}).

Right. Do we have such code currently? If not, we can remove the assertion later if we want to use such error message.

> Thus this should be a runtime check that raises an exception. What the type of an exception should be raised?

Sorry, I don't understand. funcname is not always a constant string like "func"?

Well, it was just an idea. Ignore it if you see practical issues.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30592>
_______________________________________


More information about the Python-bugs-list mailing list