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

Using the maven plugin with the default VirtualFileSystem leads to pathlib.Path.exists not working #403

Open
timfel opened this issue Jun 21, 2024 · 0 comments
Assignees

Comments

@timfel
Copy link
Member

timfel commented Jun 21, 2024

This can be observed when using pyfiglet with the maven plugin. The code of pyfiglet has this

path = importlib.resources.files('pyfiglet.fonts').joinpath(fn)
if path.exists():
    ...

path.exists() uses a stat call, and we raise (correctly) OSError for non-existing paths. But pathlib checks that the errno of that error is in a list of allowed errors, and otherwise just throws the exception upwards. The OSError raised from the VirtualFileSystem is errno 5: EIO, it should probably be errno 2: ENOENT.

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

2 participants