[issue35504] `del OSError().characters_written` raises `SystemError`

Serhiy Storchaka report at bugs.python.org
Fri Dec 14 17:56:48 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

PR 11172 makes deleting characters_written to be as for other non-special attributes. Deleting it will be successful only if it was set before, and will raise an AttributeError otherwise.

>>> e = OSError()
>>> e.characters_written = 1
>>> del e.characters_written
>>> del e.characters_written
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: characters_written

----------
versions: +Python 3.8

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


More information about the Python-bugs-list mailing list