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

Add support for PEP 519 (file system path protocol) #101

Open
Anthchirp opened this issue Apr 19, 2021 · 3 comments
Open

Add support for PEP 519 (file system path protocol) #101

Anthchirp opened this issue Apr 19, 2021 · 3 comments

Comments

@Anthchirp
Copy link
Contributor

Gemmi currently cannot deal with python path protocol objects (PEP 519, PEP 428):

$ python -c "import gemmi,pathlib; gemmi.cif.read_file(pathlib.Path('z'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: read_file(): incompatible function arguments. The following argument types are supported:
    1. (filename: str) -> gemmi.cif.Document

Invoked with: PosixPath('z')

(Presumably this is the relevant section in the PEP)

@wojdyr
Copy link
Member

wojdyr commented Apr 19, 2021

I googled how it works in combination with pybind11, but I haven't found anything.
So I think I'll wait until the path protocol is supported in pybind11, or until I come across a recipe how to handle path protocol objects.

@dkratzert
Copy link

dkratzert commented Oct 25, 2021

Is it that what you are searching for? pybind/pybind11@53da968
It is in version 2.7.0

@wojdyr
Copy link
Member

wojdyr commented Oct 25, 2021

yes, actually I've seen it recently, but I left it for later.
It can be used as an example how to support the path protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants