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
test_logging SMTPHandlerTest fails due to bad encoding #113650
Comments
Same error occurs in other places:
|
My current theory is there's an ARM64 compiler/optimizer bug that's causing UTF-8 encoding to fail when it ought to pass, and so we aren't even supposed to be in this codepath. I don't think that excuses passing surrogateescape here, that still seems wrong, even if we don't normally hit it. |
"surrogateescape" error handler encodes characters |
Do test_codecs or test_codeccallbacks fail? |
Yeah, Edit: Probably as expected. It's failing for some reason, and then failing to write the error in cp1252, which probably means it's trying to print the offending character...
|
So this would suggest that our test is broken? I can track down where that character is coming from, we do have some platform-specific code for making sure that a Unicode character is invalid on a given platform. It may be inappropriate to use that for a codec test. |
I suspect that ASCII and UTF-8 codecs may be broken. They use some clever code for optimization, and it may not work on a new platform. All other failures are derivative. Does What are values of SIZEOF_SIZE_T, SIZEOF_VOID_P, ALIGNOF_SIZE_T, ALIGNOF_LONG on this platform? Find all |
The codec tests are failing as below (I got here by setting
So apparently it's putting surrogates under |
Looks like a codegen issue that's been fixed in the next compiler version (14.38). In Just as well the ARM64 builds are still only experimental... I'll sleep on it, but I think the only thing we could do here is block compiling with that version, and all that's really going to achieve is to break our own CI, so there's probably nothing to do apart from recording the issue so people can find it (and start citing compiler instability as a reason to remain experimental...). |
Looks like it's not the real fix, and we're probably going to have to wait for a new compiler release. There's no reason to rush into reverting this change, as we just have to block the whole compiler version so it may as well stay there. Slight chance we'll find another option to disable just this issue, but it may also have multiple causes... I'm filing a specific issue for a minimal version of our code, and also looking at getting the MSVC team to use our test suite in their own regression tests. |
FTR, here's the minimal code, and showing that it's fixed in the next MSVC version. So we're just waiting on that to be properly released so that GitHub/Azure Pipelines can pick it up. |
I get this error on one of my ARM64 test machines.
The
s.encode('ascii', 'surrogateescape')
looks strange to my eyes, since ASCII doesn't have a way to encode surrogates? I assume the handler has tried to do it (hence "position 6-8" not 6-7), but really this ought to just fail (perhaps explicitly) andemail
shouldn't be passing ascii and surrogateescape together.I'm not sure why it doesn't occur on other platforms. This really ought to be an error all the time - ideas?
Linked PRs
The text was updated successfully, but these errors were encountered: