Makes PathBuf FromPyObject implementation work on all os.PathLike#3374
Makes PathBuf FromPyObject implementation work on all os.PathLike#3374adamreichold merged 2 commits intoPyO3:mainfrom
Conversation
40e250e to
3474366
Compare
| | `ipaddress.IPv4Address` | `std::net::IpAddr`, `std::net::IpV4Addr` | - | | ||
| | `ipaddress.IPv6Address` | `std::net::IpAddr`, `std::net::IpV6Addr` | - | | ||
| | `os.PathLike ` | `PathBuf`, `Path` | `&PyString`, `&PyUnicode` | | ||
| | `pathlib.Path` | `PathBuf`, `Path` | `&PyString`, `&PyUnicode` | |
There was a problem hiding this comment.
Isn't pathlib.Path also an os.PathLike, i.e. doesn't the first line basically include the second one?
There was a problem hiding this comment.
Indeed. I left the two lines for explictness because I assumed a lot of people are not used to os.PathLike. If you prefer I can remove the pathlib.Path line.
There was a problem hiding this comment.
Personally, I would merge them and maybe use "pathlib.Path, os.PathLike" for the first column to stay explicit. But let's see what the other maintainers think.
There was a problem hiding this comment.
I was thinking of upending this table anyway and describing it from the Rust types (what they accept and what they convert to), so I'm ok with leaving this as two rows for now.
PyOS_FSPath is in abi3-py36
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks - please accept the new licensing change in #3108 before we can merge this.
|
@davidhewitt Thank you! Done. |
|
Pypy 3.10 fails with "undefined reference to `PyOS_FSPath'". What is strange is that it's supposed to be supported by Pypy 3.7+: https://doc.pypy.org/en/latest/release-v7.3.0.html#python-3-6-c-api |
|
Yes, on all supported PyPy versions it looks like it is exported under the (I would love to catch cases where our definition is wrong in |
|
Thank you! I have added the
Dumb idea: if Pyo3 is supposed to cover all/most symbols expose al |
PyOS_FSPath is in abi3-py36