[issue4034] traceback attribute error

Greg Hazel report at bugs.python.org
Sun Oct 5 01:31:43 CEST 2008


Greg Hazel <ghazel at users.sourceforge.net> added the comment:

There seem to be some other exception type and string inconsistencies, 
but they are not new to Python 2.6

>>> tb.tb_frame = None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'traceback' object has only read-only attributes (assign 
to .tb_frame)

>>> tb.tb_frame.f_locals = None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: attribute 'f_locals' of 'frame' objects is not writable

>>> tb.tb_frame.f_globals = None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: readonly attribute

>>> dict.clear = "foo"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't set attributes of built-in/extension type 'dict'


Should it be an AttributeError or TypeError? Should it be "read-only", 
readonly", "not writable" or "can't set"?


Btw, here's the other ticket for the feature request: 
http://bugs.python.org/issue1565525

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


More information about the Python-bugs-list mailing list