Title: pathlib.Path.resolve() mishandles symlink loops · Issue #109187 · python/cpython · GitHub
Open Graph Title: pathlib.Path.resolve() mishandles symlink loops · Issue #109187 · python/cpython
X Title: pathlib.Path.resolve() mishandles symlink loops · Issue #109187 · python/cpython
Description: Bug report Bug description: Two closely-related issues in pathlib.Path.resolve(): First, resolve(strict=True) raises RuntimeError rather than OSError when a symlink loop is encountered. This is done only for backwards compatibility, sinc...
Open Graph Description: Bug report Bug description: Two closely-related issues in pathlib.Path.resolve(): First, resolve(strict=True) raises RuntimeError rather than OSError when a symlink loop is encountered. This is don...
X Description: Bug report Bug description: Two closely-related issues in pathlib.Path.resolve(): First, resolve(strict=True) raises RuntimeError rather than OSError when a symlink loop is encountered. This is don...
Opengraph URL: https://github.com/python/cpython/issues/109187
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pathlib.Path.resolve() mishandles symlink loops","articleBody":"# Bug report\n\n### Bug description:\n\nTwo closely-related issues in [`pathlib.Path.resolve()`](https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve):\n\nFirst, `resolve(strict=True)` raises `RuntimeError` rather than `OSError` when a symlink loop is encountered. This is done only for backwards compatibility, since #25264 made pathlib call `os.path.realpath()`. It should raise `OSError(ELOOP)`\n\nSecond, `resolve(strict=False)` suppresses every kind of OS error _except_ symlink loop errors. Again this is only for backwards compatibility. It should suppress exceptions about symlink loops.\n\nRelevant code:\n\nhttps://github.com/python/cpython/blob/e21c89f9841488a1d4ca1024dc97c1aba44e0c87/Lib/pathlib.py#L1233-L1252\n\n\n### CPython versions tested on:\n\n3.11, 3.12, CPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-109192\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-09-09T15:14:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/109187/cpython/issues/109187"}
| 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:b3fd9503-219d-a4e8-3562-e921a46260ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 900C:2A51AE:1D37A5:25C588:6969A9D4 |
| html-safe-nonce | 42a2d9f2885a49d6ace203262aaf498569920c54cebf08824aefcd153d569e75 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDBDOjJBNTFBRToxRDM3QTU6MjVDNTg4OjY5NjlBOUQ0IiwidmlzaXRvcl9pZCI6IjYyMTY5MTA3Nzk4NTI2MzA0ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ffa7385326549557ff08c95e151d2440c54fdac183ede9519d9fbcd21e3e9c73 |
| hovercard-subject-tag | issue:1888784045 |
| 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/109187/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c9f1d181a0551472da4ba8e71be2fdd8c1906ca9d054a5e25d5b3b30e4d7e67/python/cpython/issues/109187 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c9f1d181a0551472da4ba8e71be2fdd8c1906ca9d054a5e25d5b3b30e4d7e67/python/cpython/issues/109187 |
| og:image:alt | Bug report Bug description: Two closely-related issues in pathlib.Path.resolve(): First, resolve(strict=True) raises RuntimeError rather than OSError when a symlink loop is encountered. This is don... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | barneygale |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width