Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

os.path.realpath raises aValueError when path contains a null byte #117596

Open
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@stefanhoelzl

Description

@stefanhoelzl

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#L30
os.path.exists:https://github.com/python/cpython/blob/main/Lib/genericpath.py#L20
os.path.islink:https://github.com/python/cpython/blob/main/Lib/genericpath.py#L64
os.path.ismount:https://github.com/python/cpython/blob/main/Lib/posixpath.py#L197
os.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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp