You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
key_string_error=TypeError('Key/name must be a string!')
which create exception on place, where it does not occur.
And later use
raiseself.key_string_error
Which append new tracebak to existing one in this exception object so the traceback grows without bounds.
It is later imposible to debug the code, because the traceback can be very long. It also introduces memory leak, because key_string_error is class variable and is never freed.
Expected solution:
Raise new instance of TypeError('Key/name must be a string!') every time, or create new exception type with predefined message for this.
In the code, there is
which create exception on place, where it does not occur.
And later use
Which append new tracebak to existing one in this exception object so the traceback grows without bounds.
It is later imposible to debug the code, because the traceback can be very long. It also introduces memory leak, because
key_string_error
is class variable and is never freed.Expected solution:
Raise new instance of
TypeError('Key/name must be a string!')
every time, or create new exception type with predefined message for this.Example code to reproduce the issue:
The text was updated successfully, but these errors were encountered: