Skip to content
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

fix: improve bytes to str decoding error handling #4294

Merged
merged 6 commits into from
Oct 29, 2022

Conversation

Skylion007
Copy link
Collaborator

@Skylion007 Skylion007 commented Oct 28, 2022

Description

Suggested changelog entry:

* Fixed a bug where ``UnicodeDecodeError`` was not propagated from various ``py::str`` ctors when decoding surrogate utf characters.

@henryiii henryiii changed the title (bugfix): Improve bytes to str decoding error handling fix: improve bytes to str decoding error handling Oct 28, 2022
Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

tests/test_pytypes.cpp Outdated Show resolved Hide resolved
tests/test_pytypes.py Outdated Show resolved Hide resolved
@Skylion007 Skylion007 merged commit b07223f into pybind:master Oct 29, 2022
@Skylion007 Skylion007 deleted the fix-bytes-to-str-decode-excs branch October 29, 2022 15:12
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Oct 29, 2022
henryiii pushed a commit that referenced this pull request Oct 31, 2022
* (bugfix): Improve bytes to str decoding error handling

* regroup test

* Further broaden tests

* Add another decode error test

* Fix bug in tests

* Reviewer suggestions
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Oct 31, 2022
Sign up for free to 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.

3 participants