Title: Python 3.11 launcher fails with "Unable to create process" · Issue #95285 · python/cpython · GitHub
Open Graph Title: Python 3.11 launcher fails with "Unable to create process" · Issue #95285 · python/cpython
X Title: Python 3.11 launcher fails with "Unable to create process" · Issue #95285 · python/cpython
Description: Bug report When running a pip.pyz file with the py.exe launcher (itself launched from a Rust program), the command fails with the error: Unable to create process using 'C:\Users\Gustav\AppData\Local\Programs\Python\Python311\"py C:\Users...
Open Graph Description: Bug report When running a pip.pyz file with the py.exe launcher (itself launched from a Rust program), the command fails with the error: Unable to create process using 'C:\Users\Gustav\AppData\Loca...
X Description: Bug report When running a pip.pyz file with the py.exe launcher (itself launched from a Rust program), the command fails with the error: Unable to create process using 'C:\Users\Gustav\AppData\...
Opengraph URL: https://github.com/python/cpython/issues/95285
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.11 launcher fails with \"Unable to create process\"","articleBody":"# Bug report\r\n\r\nWhen running a `pip.pyz` file with the `py.exe` launcher (itself launched from a Rust program), the command fails with the error:\r\n\r\n```\r\nUnable to create process using 'C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python311\\\"py C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version': The system cannot find the file specified.\r\n```\r\n\r\nUnfortunately, I haven't been able to isolate a fully reproducible test case so far. However, I have set `$env:PYLAUNCHER_DEBUG=1` and the output of the failing command is\r\n\r\n```\r\n❯ pip --version\r\nargv0: py.exe\r\nversion: 3.11.0b5\r\n# Read 4096 bytes from C:\\Users\\Gustav\\.local\\apps\\pip.pyz to find shebang line\r\nShebang: /usr/bin/env python\r\n# Reading from C:\\Users\\Gustav\\AppData\\Local\\py.ini for commands/python\r\n# Did not find file C:\\Users\\Gustav\\AppData\\Local\\py.ini\r\n# Reading from C:\\WINDOWS\\py.ini for commands/python\r\n# Did not find file C:\\WINDOWS\\py.ini\r\n# Treating shebang command 'python' as 'py'\r\nSearchInfo.originalCmdLine: \"py.exe\" C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version\r\nSearchInfo.restOfCmdLine: C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version\r\nSearchInfo.executablePath: (null)\r\nSearchInfo.scriptFile: C:\\Users\\Gustav\\.local\\apps\\pip.pyz\r\nSearchInfo.executable: \"py\r\nSearchInfo.executableArgs:\r\nSearchInfo.company: (null)\r\nSearchInfo.tag: (empty)\r\nSearchInfo.oldStyleTag: True\r\nSearchInfo.lowPriorityTag: False\r\nSearchInfo.exclude32Bit: False\r\nSearchInfo.only32Bit: False\r\nSearchInfo.allowDefaults: False\r\nSearchInfo.allowExecutableOverride: False\r\nSearchInfo.windowed: False\r\nSearchInfo.list: False\r\nSearchInfo.listPaths: False\r\nSearchInfo.help: False\r\n -V:3.11 C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python311\\python.exe\r\n -V:3.10 C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python310\\python.exe\r\n -V:3.9 C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python39\\python.exe\r\n -V:3.8 C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python38\\python.exe\r\nenv.company: PythonCore\r\nenv.tag: 3.11\r\n# about to run: C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python311\\\"py C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version\r\nUnable to create process using 'C:\\Users\\Gustav\\AppData\\Local\\Programs\\Python\\Python311\\\"py C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version': The system cannot find the file specified.\r\n```\r\n\r\nThe key issue seems to be\r\n\r\n```\r\nSearchInfo.executable: \"py\r\n```\r\n\r\n(note the unbalanced quotes) which appears to be a result of incorrectly parsing the following:\r\n\r\n```\r\nSearchInfo.originalCmdLine: \"py.exe\" C:\\Users\\Gustav\\.local\\apps\\pip.pyz --version\r\n```\r\n\r\nI can create the same debug output using the internal `_winapi.CreateProcess` function:\r\n\r\n```\r\n_winapi.CreateProcess(\"C:/Windows/py.exe\", '\"py.exe\" -0', None, None, 0, 0, None, None, 0)\r\n```\r\n\r\nSo the problem appears to be when the command line passed to `CreateProcess` contains a double quoted but relative filename.\r\n\r\n# Your environment\r\n\r\n- Python and launcher from 3.11.0b5.\r\n- Operating system and architecture: Windows 11, 64-bit.\r\n","author":{"url":"https://github.com/pfmoore","@type":"Person","name":"pfmoore"},"datePublished":"2022-07-26T14:47:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/95285/cpython/issues/95285"}
| 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:b8defd7a-1a36-2b57-f726-a8c3ccee3b76 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD46:17997A:923F57:C45B75:6969BF36 |
| html-safe-nonce | adc28c68daa21d89db0199a6039b48b9a534c65a8630fab2e6d92503e9cd0819 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDQ2OjE3OTk3QTo5MjNGNTc6QzQ1Qjc1OjY5NjlCRjM2IiwidmlzaXRvcl9pZCI6IjY2ODIxNzgwNDE0OTgxNTY4NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 57e5d548a181750a0d19ed258af93a49fc80f80431d3678fa74698788aa5a671 |
| hovercard-subject-tag | issue:1318354123 |
| 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/95285/issue_layout |
| twitter:image | https://opengraph.githubassets.com/45ef8a49a9f1b71d0529be9bac1b050c6a480fa1cecb315e101786fcefd12d84/python/cpython/issues/95285 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/45ef8a49a9f1b71d0529be9bac1b050c6a480fa1cecb315e101786fcefd12d84/python/cpython/issues/95285 |
| og:image:alt | Bug report When running a pip.pyz file with the py.exe launcher (itself launched from a Rust program), the command fails with the error: Unable to create process using 'C:\Users\Gustav\AppData\Loca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pfmoore |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width