-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
After disconnecting and reconnecting my external hard drive (with my current working directory on it), I get surprising results from the os:
>>> os.path.exists('test.csv')
False
>>> os.path.exists(os.path.join(os.getcwd(),'test.csv'))
True
>>> 'test.csv' in list(os.listdir())
True
>>> file=open('test.csv','r')
Traceback (most recent call last):
File "<python-input-200>", line 1, in <module>
file=open('test.csv','r')
OSError: [Errno 22] Invalid argument: 'test.csv'
Expected behavior: Keep the same working directory and only throw an error or return os.path.exists()=False if it is inaccessible at runtime.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error