Title: os.path.realpath(symlink to DOS devices path that starts with '\\?\Some without ":"\') returns without prefix. · Issue #102440 · python/cpython · GitHub
Open Graph Title: os.path.realpath(symlink to DOS devices path that starts with '\\?\Some without ":"\') returns without prefix. · Issue #102440 · python/cpython
X Title: os.path.realpath(symlink to DOS devices path that starts with '\\?\Some without ":"\') returns without prefix. · Issue #102440 · python/cpython
Description: os.path.realpath(symblic link to DOS Device Paths) returns a path without \\?\ prefix even if patch that fix. For example, there is below symlinks on C:\test. C:\test>dir 03/05/2023 06:16 AM
Open Graph Description: os.path.realpath(symblic link to DOS Device Paths) returns a path without \\?\ prefix even if patch that fix. For example, there is below symlinks on C:\test. C:\test>dir 03/05/2023 06:16 AM X Description: os.path.realpath(symblic link to DOS Device Paths) returns a path without \\?\ prefix even if patch that fix. For example, there is below symlinks on C:\test. C:\test>dir 03/05/2023 06:16 AM <...
Opengraph URL: https://github.com/python/cpython/issues/102440
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"os.path.realpath(symlink to DOS devices path that starts with '\\\\?\\Some without \":\"\\') returns without prefix.","articleBody":"``` os.path.realpath(symblic link to DOS Device Paths) ``` returns a path without ``` \\\\?\\ ``` prefix even if patch that fix.\r\n\r\nFor example, there is below symlinks on C:\\test.\r\n```\r\nC:\\test\u003edir\r\n03/05/2023 06:16 AM \u003cSYMLINKD\u003e media [\\\\?\\ContainerMappedDirectories\\CE94A662-0837-4F45-B403-55B3E57CE848]\r\n03/05/2023 06:19 AM \u003cSYMLINKD\u003e to_c [\\\\?\\C:\\]\r\n```\r\n\r\nThen exexute python and call os.path.realpath and call some functions to inspect.\r\n```python\r\n\u003e\u003e\u003e import os\r\n\u003e\u003e\u003e from ntpath import normpath, normcase, devnull, join, isabs, _getfinalpathname, _getfinalpathname_nonstrict\r\n\u003e\u003e\u003e\r\n\u003e\u003e\u003e to_c_fn = r'to_c'\r\n\u003e\u003e\u003e media_fn = r'media'\r\n\u003e\u003e\u003e os.path.realpath(to_c_fn)\r\n'C:\\\\'\r\n\u003e\u003e\u003e os.path.realpath(media_fn)\r\n'\\\\ContainerMappedDirectories\\\\CE94A662-0837-4F45-B403-55B3E57CE848'\r\n\u003e\u003e\u003e _getfinalpathname(to_c_fn)\r\n'\\\\\\\\?\\\\C:\\\\'\r\n\u003e\u003e\u003e _getfinalpathname(media_fn)\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nFileNotFoundError: [WinError 2] The system cannot find the file specified: 'media'\r\n\u003e\u003e\u003e _getfinalpathname_nonstrict(to_c_fn)\r\n'\\\\\\\\?\\\\C:\\\\'\r\n\u003e\u003e\u003e _getfinalpathname_nonstrict(media_fn)\r\n'\\\\ContainerMappedDirectories\\\\CE94A662-0837-4F45-B403-55B3E57CE848'\r\n```\r\nAs the log indicates, os.path.realpath returns without a prefix.\r\n\r\nI think it is wrong that _getfinalpathname_nonstrict removes DOS devices paths prefix.\r\nSo to fix the problem, I think we need to fix _getfinalpathname function on \"Modules/posixmodule.c\".\r\n\r\nPlease some opinions.","author":{"url":"https://github.com/wintermaples","@type":"Person","name":"wintermaples"},"datePublished":"2023-03-05T15:01:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/102440/cpython/issues/102440"}
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:af836bb2-86af-9e72-e2b3-0a3b0a0a30eb current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id B022:D0E56:217DB20:2DF8A4F:696AC397 html-safe-nonce ec0e6a0bbc8163e028b54d68b2c8a19f54f0cb00e25c5ce1eb621806805e0ae7 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDIyOkQwRTU2OjIxN0RCMjA6MkRGOEE0Rjo2OTZBQzM5NyIsInZpc2l0b3JfaWQiOiI2MjI4MzgyMzE4NDEwMzEwNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac b931b080e0bb14854c650deaf1a0c792493c758866f502cc1ecb17facd80896e hovercard-subject-tag issue:1610234398 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/102440/issue_layout twitter:image https://opengraph.githubassets.com/e211bed9001c5eca9314acc6c35fe90665c7eb4c991675114629c4875215080c/python/cpython/issues/102440 twitter:card summary_large_image og:image https://opengraph.githubassets.com/e211bed9001c5eca9314acc6c35fe90665c7eb4c991675114629c4875215080c/python/cpython/issues/102440 og:image:alt os.path.realpath(symblic link to DOS Device Paths) returns a path without \\?\ prefix even if patch that fix. For example, there is below symlinks on C:\test. C:\test>dir 03/05/2023 06:16 AM og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username wintermaples hostname github.com expected-hostname github.com None 986b6a1d774985095564e64d6963d11f094da3d0e2bfda2ab1a27d63662eb033 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 89ad2112b9c4e11df6a0c13c8c1f8eedd36b0977 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.