Title: `os.path.realpath` raises a `ValueError` when path contains a null byte · Issue #117596 · python/cpython · GitHub
Open Graph Title: `os.path.realpath` raises a `ValueError` when path contains a null byte · Issue #117596 · python/cpython
X Title: `os.path.realpath` raises a `ValueError` when path contains a null byte · Issue #117596 · python/cpython
Description: Bug report Bug description: import os os.path.realpath("\x00") # raises unexpected ValueError The ValueError is initially raised by os.lstat. This behavior is inconsistent with other path operations catching the ValueError raised by os.l...
Open Graph Description: Bug report Bug description: import os os.path.realpath("\x00") # raises unexpected ValueError The ValueError is initially raised by os.lstat. This behavior is inconsistent with other path operation...
X Description: Bug report Bug description: import os os.path.realpath("\x00") # raises unexpected ValueError The ValueError is initially raised by os.lstat. This behavior is inconsistent with other path...
Opengraph URL: https://github.com/python/cpython/issues/117596
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`os.path.realpath` raises a `ValueError` when path contains a null byte","articleBody":"# Bug report\n\n### Bug description:\n\n```python\nimport os\nos.path.realpath(\"\\x00\") # raises unexpected ValueError\n```\n\nThe `ValueError` is initially raised by `os.lstat`.\n\nThis behavior is inconsistent with other path operations catching the `ValueError` raised by `os.lstat`:\n`os.path.lexsists`: https://github.com/python/cpython/blob/main/Lib/genericpath.py#L30\n`os.path.exists`: https://github.com/python/cpython/blob/main/Lib/genericpath.py#L20\n`os.path.islink`: https://github.com/python/cpython/blob/main/Lib/genericpath.py#L64\n`os.path.ismount`: https://github.com/python/cpython/blob/main/Lib/posixpath.py#L197\n`os.path.ismount`: https://github.com/python/cpython/blob/main/Lib/posixpath.py#L213\n\n### CPython versions tested on:\n\n3.10, CPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-117573\n* gh-134189\n* gh-134265\n* gh-134266\n* gh-142415\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/stefanhoelzl","@type":"Person","name":"stefanhoelzl"},"datePublished":"2024-04-07T06:42:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/117596/cpython/issues/117596"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7db79c3a-180f-2a23-1995-b267a6e0915b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B54A:2E7615:A32861:D578A5:696B5635 |
| html-safe-nonce | 82d64c07fa40cf363c5b9cd9b14ac25dc0dbafcd0e06fb7db1e7d8787e9a0e60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTRBOjJFNzYxNTpBMzI4NjE6RDU3OEE1OjY5NkI1NjM1IiwidmlzaXRvcl9pZCI6IjU1OTc2OTk0MzkyMDgzODgxNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f635dfcb71fa7424e285a8535a5da5b4fd68584053792729b211e860b0678018 |
| hovercard-subject-tag | issue:2229593710 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/117596/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce5bcaf7579a5be61ad10a510afd87af925e3e13f98f3ebe4ecf2aed6a814112/python/cpython/issues/117596 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce5bcaf7579a5be61ad10a510afd87af925e3e13f98f3ebe4ecf2aed6a814112/python/cpython/issues/117596 |
| og:image:alt | Bug report Bug description: import os os.path.realpath("\x00") # raises unexpected ValueError The ValueError is initially raised by os.lstat. This behavior is inconsistent with other path operation... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stefanhoelzl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width