-
Notifications
You must be signed in to change notification settings - Fork 355
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
Base64IO: set write buffer before doing attr check #1377
Conversation
TestBase64IO.test_init_fails() fails in current Fedora Rawhide (with Python 3.13) because pytest complains about an unraisable exception: AttributeError: 'Base64IO' object has no attribute '_Base64IO__write_buffer' it seems like we're reaching `close()` (via `__exit__()`, I guess) even after raising an exception in `__init__()`, and that causes a problem because we never set `self.__write_buffer` if the required attrs check fails. To solve this, we can just set `self.__write_buffer` before doing the attr check. Signed-off-by: Adam Williamson <[email protected]>
This is the full failure log:
I'm not honestly sure exactly what changed to trigger this, though Python 3.13 seems like a good bet. It's a little mysterious, but as it's relatively easy to solve, I just went ahead and wrote this and didn't dig too deeply into the exact reason why we're suddenly apparently reaching |
Yeah, I'm not certain either, but thanks for pointing this out. I'm going to let this PR hang around a bit until we get Python 3.13 into our testing CI (we don't claim to be compatible with that version just yet). |
Including this change in PR #1379 and added you as co-author, so I'll close this. Thanks. |
TestBase64IO.test_init_fails() fails in current Fedora Rawhide (with Python 3.13) because pytest complains about an unraisable exception:
AttributeError: 'Base64IO' object has no attribute '_Base64IO__write_buffer'
it seems like we're reaching
close()
(via__exit__()
, I guess) even after raising an exception in__init__()
, and that causes a problem because we never setself.__write_buffer
if the required attrs check fails.To solve this, we can just set
self.__write_buffer
before doing the attr check.