bpo-35942: Improve the error message if __fspath__ returns invalid types in path_converter#11831
bpo-35942: Improve the error message if __fspath__ returns invalid types in path_converter#11831pablogsal merged 4 commits intopython:masterfrom
Conversation
|
The issue number is wrong. |
11b6b0b to
f663492
Compare
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I don't like this. It makes error messages for incorrect type of arguments worse.
Change only error messages for __fspath__() returning incorrect result.
|
When you're done making the requested changes, leave the comment: |
|
@serhiy-storchaka I have changed the approach to only correct messages for I have made the requested changes; please review again |
|
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
|
@serhiy-storchaka Thank you very much for the thorough review! I have addressed your feedback in 477daf8. |
|
I think this bugfix is worth a news entry. |
ambv
left a comment
There was a problem hiding this comment.
Thanks for jumping on this so quickly, @pablogsal!
| } | ||
|
|
||
| /* still owns a reference to the original object */ | ||
| Py_DECREF(o); |
There was a problem hiding this comment.
A little question, Why don't make Py_DECREF(res); too?
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-11912 is a backport of this pull request to the 3.7 branch. |
…pes in path_converter (pythonGH-11831) The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error. (cherry picked from commit 09fbcd6) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
…pes in path_converter (GH-11831) The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error. (cherry picked from commit 09fbcd6) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
https://bugs.python.org/issue35942