oracle / oracle/graalpython

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

Offen
#403 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@tstupka arbeitet bereits daran.

Seit 21.6.2024.

good first issue
Vorherrschende Sprache
Python
Sterne
1.6k
Forks
155
Ø Merge
9 Std. 42 Min.
Gemergte PRs (30 T.)
36

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.