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

PyPy3.10: xattr.getxattr() does not accept pathlib.Path whereas it works on CPython #41

Closed
mgorny opened this issue Nov 17, 2023 · 12 comments

Comments

@mgorny
Copy link

mgorny commented Nov 17, 2023

$ pypy3.10 -c 'import pathlib, xattr; xattr.getxattr(pathlib.Path("/"), "user.test")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: Can't convert 'PosixPath' object to str implicitly
# but
$ python3.10 -c 'import pathlib, xattr; xattr.getxattr(pathlib.Path("/"), "user.test")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 61] No data available

I think the line in question is:

pyxattr/xattr.c

Line 439 in 1d04275

if (!PyArg_ParseTuple(args, "Oet|i", &myarg, NULL, &attrname, &nofollow))

I suppose CPython implicitly converts pathlib.Path to a string, whereas PyPy throws an error.

CC @mattip

@mgorny
Copy link
Author

mgorny commented Nov 17, 2023

Oh, sorry, I was looking at the wrong argument. It's probably https://foss.heptapod.net/pypy/pypy/-/issues/3168; i.e. PyUnicode_FSConverter not handling Path objects.

@mattip
Copy link

mattip commented Nov 21, 2023

Could you change CI to use pypy-3.10-nightly, pypy-3.9-nightly and ping me on CI failures?

- 'pypy-3.7'
- 'pypy-3.8'
- 'pypy-3.9'

@mattip
Copy link

mattip commented Nov 21, 2023

I added handling for Path objects to latest nightlies.

@iustin
Copy link
Owner

iustin commented Nov 24, 2023

I've switch to pypy-3.9-nightly and 3.10-nightly. The run passed: https://github.com/iustin/pyxattr/actions/runs/6982967019.

@jabbalaci
Copy link

You can always convert a Path object to string with str(Path(...)) and you are done.

@mattip
Copy link

mattip commented Feb 6, 2024

@iustin you may want to switch back to the last stable release which contains the fix I mentioned above, since using nightlies may be noisy (no guarantee they work all the time)

@iustin
Copy link
Owner

iustin commented Feb 6, 2024

@iustin you may want to switch back to the last stable release which contains the fix I mentioned above, since using nightlies may be noisy (no guarantee they work all the time)

I was actually going to ask about that, since I had to disable 3.10-nightly yesterday.

Is there a canonical list of the stable releases?

@mattip
Copy link

mattip commented Feb 6, 2024

There are a few :)

The list of released downloads as a json file (consumed by the python setup github action) is here, and the downloads themselves are here

The changelogs are here, and you can see the fix for this issue in the version-specific changelog.

iustin added a commit that referenced this issue Feb 6, 2024
Based on #41, this can be re-enabled now.
iustin added a commit that referenced this issue Feb 6, 2024
Based on #41, this can be re-enabled now.
@iustin
Copy link
Owner

iustin commented Feb 6, 2024

I've re-enabled pypy-3.10, and moved 3.9 from nightly to well, no nightly.

However, it's still not clear to me how to read the list of releases. E.g. from this snippet:

  {
    "pypy_version": "7.3.15",
    "python_version": "3.9.18",
    "stable": true,
    "latest_pypy": true,
    "date": "2024-01-15",
  …

How do you get to a valid python-version: pypy-3.9? Maybe more to the point, how can I subscribe and know when new stable versions are released? Is there a `pypy-latest' but stable?

iustin added a commit that referenced this issue Feb 6, 2024
From #41, the Pathlib issues should have been fixed under PyPy, so enable these as well to prevent regressions.
@iustin iustin mentioned this issue Feb 6, 2024
iustin added a commit that referenced this issue Feb 6, 2024
From #41, the Pathlib issues should have been fixed under PyPy, so enable these as well to prevent regressions.
iustin added a commit that referenced this issue Feb 6, 2024
Per #41, this is now fixed in pypy 3.10, so we can enable the tests to prevent regressions.
iustin added a commit that referenced this issue Feb 6, 2024
Per #41, this is now fixed in pypy 3.10, so we can enable the tests to prevent regressions.
iustin added a commit that referenced this issue Feb 6, 2024
Per #41, this is now fixed in pypy 3.10, so we can enable the tests
to prevent regressions. That makes pypy-3.10 the first pypy version
that runs all tests that cpython does!
iustin added a commit that referenced this issue Feb 6, 2024
Per #41, this is now fixed in pypy 3.10, so we can enable the tests
to prevent regressions. That makes pypy-3.10 the first pypy version
that runs all tests that cpython does!
@iustin
Copy link
Owner

iustin commented Feb 6, 2024

I've enabled PathLib tests under pypy 3.10, which means it now runs all tests that CPython does. I'll mark this issue closed, now. Thanks all!

@iustin iustin closed this as completed Feb 6, 2024
@mattip
Copy link

mattip commented Feb 7, 2024

how can I subscribe and know when new stable versions are released

You can get notified of changes to the download site via something like https://visualping.io/

@iustin
Copy link
Owner

iustin commented Feb 7, 2024

Well, yes, thanks, but I was hoping that there would be something built-in to GitHub actions marketplace, or similar. All good, I can periodically check myself.

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

No branches or pull requests

4 participants