Skip to content

Fix & test for issue #4288 (unicode surrogate character in Python exception message). - #4297

Merged
henryiii merged 4 commits into
pybind:masterfrom
rwgk:error_already_set_unicode_surrogate
Oct 31, 2022
Merged

Fix & test for issue #4288 (unicode surrogate character in Python exception message).#4297
henryiii merged 4 commits into
pybind:masterfrom
rwgk:error_already_set_unicode_surrogate

Conversation

@rwgk

@rwgkrwgk commented Oct 31, 2022

Copy link
Copy Markdown
Collaborator

Description

Closes#4288. See there for background.

While at it:

Suggested changelog entry:

Bug fix: Unicode surrogate character in Python exception message leads to process termination in `error_already_set::what()`.

@rwgkrwgk mentioned this pull request Oct 31, 2022
@rwgk
rwgk marked this pull request as ready for review October 31, 2022 00:43
@henryiii

henryiii commented Oct 31, 2022

Copy link
Copy Markdown
Collaborator

PyPy 3.7 Windows gave:

MSBuild version 17.3.1+2badb37d1 for .NET Framework
Checking File Globs
cross_module_gil_utils.vcxproj -> D:\a\pybind11\pybind11\build2\tests\cross_module_gil_utils.pypy37-pp73-win_amd64.pyd
cross_module_interleaved_error_already_set.vcxproj -> D:\a\pybind11\pybind11\build2\tests\cross_module_interleaved_error_already_set.pypy37-pp73-win_amd64.pyd
pybind11_cross_module_tests.vcxproj -> D:\a\pybind11\pybind11\build2\tests\pybind11_cross_module_tests.pypy37-pp73-win_amd64.pyd
pybind11_tests.vcxproj -> D:\a\pybind11\pybind11\build2\tests\pybind11_tests.pypy37-pp73-win_amd64.pyd
------ pybind11_tests.pypy37-pp73-win_amd64.pyd file size: 23571968 (no change)
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'D:\a\pybind11\pybind11\build2\CMakeFiles\c74e89d6f5f1ea108a7628c93f4b5083\pytest.rule;D:\a\pybind11\pybind11\tests\CMakeLists.txt' exited with code -1073741819. [D:\a\pybind11\pybind11\build2\tests\pytest.vcxproj]

That's the expected flake, or something else? Either way, I can rerun. You can access old runs at the top of the checks screen, there's a selectable run number there.

Comment threadtests/test_exceptions.cpp
@rwgk

rwgk commented Oct 31, 2022

Copy link
Copy Markdown
CollaboratorAuthor

PyPy 3.7 Windows gave:
That's the expected flake, or something else?

Something else. I've seen it for the first time 2-3 months ago. I don't know what's behind it, at all. But clearly not related to this PR.

Comment threadinclude/pybind11/pytypes.h Outdated
henryiiiand others added 2 commits October 31, 2022 11:04
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
@henryiii
henryiii merged commit 3a2c96b into pybind:masterOct 31, 2022
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label Oct 31, 2022
@rwgk
rwgk deleted the error_already_set_unicode_surrogate branch October 31, 2022 18:01
henryiii added a commit that referenced this pull request Oct 31, 2022
* Fix & test for issue #4288 (unicode surrogate character in Python exception message).
* DRY `message_unavailable_exc`
* fix: add a constexpr
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
* style: pre-commit fixes
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@henryiiihenryiii removed the needs changelog Possibly needs a changelog entry label Oct 31, 2022
rwgk added a commit that referenced this pull request Nov 18, 2022
* Fix & test for issue #4288 (unicode surrogate character in Python exception message).
* DRY `message_unavailable_exc`
* fix: add a constexpr
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
* style: pre-commit fixes
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@rwgkrwgk mentioned this pull request Feb 11, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: exception in noexcept what() when Python exception contains a surrogate character

3 participants

@rwgk@henryiii@Skylion007