Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

pathlib.Path().exists doesn't work correctly #80

Open
@wolfv

Description

@wolfv

For some reason, this fails with an error in xeus-python but works in pyodide/pyolite:

import os
import pathlib
os.path.exists("/drive/idontexist")
pathlib.Path("/drive/idontexist").exists()

In xeus-python it prints:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/tmp/xpython_42/3913635030.py in <cell line: 4>()
      2 import pathlib
      3 os.path.exists("/drive/idontexist")
----> 4 pathlib.Path("/drive/idontexist").exists()

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/pathlib.py in exists(self)
   1286         """
   1287         try:
-> 1288             self.stat()
   1289         except OSError as e:
   1290             if not _ignore_error(e):

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/pathlib.py in stat(self, follow_symlinks)
   1093         os.stat() does.
   1094         """
-> 1095         return self._accessor.stat(self, follow_symlinks=follow_symlinks)
   1096 
   1097     def owner(self):

OSError: [Errno 28] Invalid argument: '/drive/idontexist'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions