Uh oh!
There was an error while loading. Please reload this page.
Add check if str(handle) correctly converted the object, and throw py::error_already_set if not - #2392
Conversation
YannickJadoul
commented
Aug 14, 2020
Also note that by checking always checking the result after calling |
YannickJadoul
commented
Aug 14, 2020
Of course. I tried this locally based on #2380, but |
235168a to
d58307dCompareYannickJadoul
commented
Aug 14, 2020
Uh oh!
There was an error while loading. Please reload this page.
f38fafc to
6cd4552Compare7eee06e to
366f713Compare
bstaletic
left a comment
There was a problem hiding this comment.
Looks good, apart from that sys.version.major thing.
366f713 to
6452317Compare@YannickJadoul if you used |
This might benefit from being rebased after #2397 |
6452317 to
b25eaceCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
YannickJadoul
commented
Aug 16, 2020
OK, you win this one ;-) |
b25eace to
f7d376cCompare0b49467 to
0ab4b97Compare…py::error_already_set if not
f7d376c to
8e53b83Compare8e53b83 to
3dbafa6CompareYannickJadoul
commented
Aug 16, 2020
Fixed this. It's quite a minor PR, so a few more quick checks (@bstaletic & @henryiii, the things you mentioned should be fixed). |
wjakob
commented
Aug 17, 2020
LGTM. |
rwgk
left a comment
There was a problem hiding this comment.
Looks great, thanks Yannick!
I'll hold off merging only because I'm still unclear why the current str-bytes-cleanup branch fails to pass some tests in the Google environment (I didn't get a chance to work on it at all yesterday).
(For completeness: the failing tests are NOT pybind11 unit tests.)
rwgk
commented
Aug 17, 2020
For future reference: the test failure was due to accidental |
… py::error_already_set if not. Similar to pybind#2392, but does not depend on pybind#2409. Splitting out this PR from pybind#2409 to make that PR as simple as possible. Net effects of this PR: * Adds missing test coverage. * Changes TypeError to UnicodeDecodeError for Python 2. This PR has two commits. Please do not squash, to make the behavior change obvious in the commit history.
Only problematic on Python 2, I think. Discovered here: #2380 (comment)