Title: venv does not respect `PYTHONDONTWRITEBYTECODE` setting · Issue #98251 · python/cpython · GitHub
Open Graph Title: venv does not respect `PYTHONDONTWRITEBYTECODE` setting · Issue #98251 · python/cpython
X Title: venv does not respect `PYTHONDONTWRITEBYTECODE` setting · Issue #98251 · python/cpython
Description: When we invoke pip, we use -I to avoid interference from other variables. However, this also means that we ignore legitimate user preferences that ought to be retained. We probably want PYTHONDONTWRITEBYTECODE, PYTHONUTF8, PYTHONIOENCODI...
Open Graph Description: When we invoke pip, we use -I to avoid interference from other variables. However, this also means that we ignore legitimate user preferences that ought to be retained. We probably want PYTHONDONTW...
X Description: When we invoke pip, we use -I to avoid interference from other variables. However, this also means that we ignore legitimate user preferences that ought to be retained. We probably want PYTHONDONTW...
Opengraph URL: https://github.com/python/cpython/issues/98251
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"venv does not respect `PYTHONDONTWRITEBYTECODE` setting","articleBody":"When [we invoke pip](https://github.com/python/cpython/blob/main/Lib/venv/__init__.py#L347), we use `-I` to avoid interference from other variables. However, this also means that we ignore legitimate user preferences that ought to be retained. We probably want `PYTHONDONTWRITEBYTECODE`, `PYTHONUTF8`, `PYTHONIOENCODING`, `PYTHONMALLOC`, `PYTHONCOERCECLOCALE`, `PYTHONPYCACHEPREFIX` at least, and maybe more (I just went through the help output of 3.10).\r\n\r\nInterestingly, we don't use isolated mode later on when we upgrade the packages, so maybe we don't need it at all? Or perhaps we should be in some middle ground where we override `PYTHONPATH` and `PYTHONHOME` to point at the venv/be empty but leave everything else in place?\r\n\r\nPing @vsajip \r\n\r\n(Discovered in a system where attempting to write .pyc files would break.)","author":{"url":"https://github.com/zooba","@type":"Person","name":"zooba"},"datePublished":"2022-10-13T21:44:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/98251/cpython/issues/98251"}
| 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:d6eabfd7-9f0b-583b-2800-d8451d2abdfc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C810:217FCE:D746AB:128621C:6969ECE5 |
| html-safe-nonce | e58abe29f476c1a5247fe7a7805a54c81bb946e2d820c777e5603ba22dbf85fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODEwOjIxN0ZDRTpENzQ2QUI6MTI4NjIxQzo2OTY5RUNFNSIsInZpc2l0b3JfaWQiOiI1MjczNDA3NTY0MTU2NjI4MTk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 223cd08a7b183b0cfdb5c8552d25103017f44d327de7b8e95136f77fc62e7362 |
| hovercard-subject-tag | issue:1408461034 |
| 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/98251/issue_layout |
| twitter:image | https://opengraph.githubassets.com/59faddcfb35717292a88a16ef07212c2a9427292797442fc9bad35460829f5ee/python/cpython/issues/98251 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/59faddcfb35717292a88a16ef07212c2a9427292797442fc9bad35460829f5ee/python/cpython/issues/98251 |
| og:image:alt | When we invoke pip, we use -I to avoid interference from other variables. However, this also means that we ignore legitimate user preferences that ought to be retained. We probably want PYTHONDONTW... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zooba |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width