Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
Bug report
Bug description:
importosos.path.realpath("\x00")# raises unexpected ValueError
TheValueError
is initially raised byos.lstat
.
This behavior is inconsistent with other path operations catching theValueError
raised byos.lstat
:os.path.lexsists
:https://github.com/python/cpython/blob/main/Lib/genericpath.py#L30os.path.exists
:https://github.com/python/cpython/blob/main/Lib/genericpath.py#L20os.path.islink
:https://github.com/python/cpython/blob/main/Lib/genericpath.py#L64os.path.ismount
:https://github.com/python/cpython/blob/main/Lib/posixpath.py#L197os.path.ismount
:https://github.com/python/cpython/blob/main/Lib/posixpath.py#L213
CPython versions tested on:
3.10, CPython main branch
Operating systems tested on:
Linux