-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
del OSError().characters_written
raises SystemError
#79685
Comments
I don't know why anyone should try this in productive code, but since the documentation says, that every |
del OSError().characters_written
raises SystemErrordel OSError().characters_written
raises SystemError
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 |
Why is it using -1 instead of NULL as the "not-set-indicator"? -1 is a valid python integer, that can be assigned, even if it doesn't make sense in the context, while |
PR 11175 fixes some other related SystemErrors (and segfaults). |
Because the field of the C structure has integer type, and it can not be the NULL pointer. |
Good catch Zackery! Thank you for your PR. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: