René's URL Explorer Experiment


Title: Make `:PymodeRun` execute with the activated virtualenv interpreter by Copilot · Pull Request #1200 · python-mode/python-mode · GitHub

Open Graph Title: Make `:PymodeRun` execute with the activated virtualenv interpreter by Copilot · Pull Request #1200 · python-mode/python-mode

X Title: Make `:PymodeRun` execute with the activated virtualenv interpreter by Copilot · Pull Request #1200 · python-mode/python-mode

Description: `Pymode` correctly detected/activated virtualenvs, but `:PymodeRun` still executed code with Vim's embedded/system Python, causing version mismatch (e.g. active 3.13 venv, output from 3.14 system Python). This change aligns run behavior with virtualenv activation so executed code uses the selected environment interpreter. Run-path correction for virtualenv-enabled sessions Updated `pymode/run.py` so `run_code()` checks `g:pymode_virtualenv_enabled` and resolves the venv Python executable (`bin/python` on Unix, `Scripts/python.exe` on Windows). When available, code is executed via that interpreter through a temp script + subprocess, preserving cwd and capturing stdout/stderr for existing quickfix/output flow. Keeps existing in-process execution path as fallback when no active virtualenv interpreter is available. Correctness fixes `file` is now set to the real source file path inside the subprocess (previously resolved to the temp file path, breaking code that uses `file` at runtime). Subprocess tracebacks have the temp file path replaced with the real source path so error messages point to the correct file. Explicit UTF-8 encoding passed to `subprocess.Popen`. Added `g:pymode_run_timeout` (default `0` = no limit) to prevent Vim from hanging if a script never terminates; `TimeoutExpired` is caught, the process is killed, and an error message is appended. Pre-existing bug fixed: `sys.stdout`/`sys.stderr` are now restored before returning early on a non-zero `SystemExit`. Regression coverage Added a focused Vader test in `tests/vader/commands.vader` that: creates a temporary virtualenv, activates it with `:PymodeVirtualenv`, runs `:PymodeRun`, asserts `run` output includes the venv interpreter path. Fixed `string(venv_dir)` → `fnameescape(venv_dir)` in the test (`string()` wraps the path in quotes, producing a malformed argument). Test now saves and restores `g:pymode_virtualenv_enabled` / `g:pymode_virtualenv` so it does not pollute subsequent tests. Cleanup (`delete`) and state restore run unconditionally regardless of whether venv creation succeeded. Docs update Clarified in `doc/pymode.txt` that `:PymodeRun` uses the virtualenv Python executable when a virtualenv is activated. Added `g:pymode_run_timeout` default in `plugin/pymode.vim`. ```python before: often printed system interpreter from Vim host runtime import sys print(sys.executable) after: with :PymodeVirtualenv .venv, prints .../.venv/bin/python (or Scripts/python.exe) ```

Open Graph Description: `Pymode` correctly detected/activated virtualenvs, but `:PymodeRun` still executed code with Vim's embedded/system Python, causing version mismatch (e.g. active 3.13 venv, output from 3.14 syst...

X Description: `Pymode` correctly detected/activated virtualenvs, but `:PymodeRun` still executed code with Vim's embedded/system Python, causing version mismatch (e.g. active 3.13 venv, output from 3.14 ...

Opengraph URL: https://github.com/python-mode/python-mode/pull/1200

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:775d69ff-7e40-ced9-932a-bd99558c3806
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD86C:3194F6:542EFF:6EF811:6AFE6994
html-safe-noncecb332efbb5edb4ef17c4e17de7d63500b32955a496ba2f0b57a5ece9198583d7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODZDOjMxOTRGNjo1NDJFRkY6NkVGODExOjZBRkU2OTk0IiwidmlzaXRvcl9pZCI6IjMxNjM1Mzg0NTgwNzc0NTY3ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacff5d11e50ff032c1c4dda041fe448f4d9e5970653a2d8e30b58a3c70dbf6e533
hovercard-subject-tagpull_request:3563933678
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-mode/python-mode/pull/1200/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:alt`Pymode` correctly detected/activated virtualenvs, but `:PymodeRun` still executed code with Vim's embedded/system Python, causing version mismatch (e.g. active 3.13 venv, output from 3.14 syst...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python-mode/python-mode git https://github.com/python-mode/python-mode.git
octolytics-dimension-user_id13965098
octolytics-dimension-user_loginpython-mode
octolytics-dimension-repository_id2408911
octolytics-dimension-repository_nwopython-mode/python-mode
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id2408911
octolytics-dimension-repository_network_root_nwopython-mode/python-mode
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a10310af51a1bfffbedc4fd81cb582acf0cb0ff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-mode/python-mode/pull/1200/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-mode%2Fpython-mode%2Fpull%2F1200%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-mode%2Fpython-mode%2Fpull%2F1200%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python-mode%2Fpython-mode
Reloadhttps://github.com/python-mode/python-mode/pull/1200/files
Reloadhttps://github.com/python-mode/python-mode/pull/1200/files
Reloadhttps://github.com/python-mode/python-mode/pull/1200/files
python-modehttps://github.com/python-mode
python-modehttps://github.com/python-mode/python-mode
Codehttps://github.com/python-mode/python-mode
Issues38 (38)https://github.com/python-mode/python-mode/issues
Pull requests1 (1)https://github.com/python-mode/python-mode/pulls
Actionshttps://github.com/python-mode/python-mode/actions
Projectshttps://github.com/python-mode/python-mode/projects
Wikihttps://github.com/python-mode/python-mode/wiki
Security and qualityhttps://github.com/python-mode/python-mode/security
Insightshttps://github.com/python-mode/python-mode/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-mode%2Fpython-mode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-mode%2Fpython-mode%2Fissues%2Fnew%2Fchoose
Copilothttps://github.com/apps/copilot-swe-agent
develophttps://github.com/python-mode/python-mode/tree/develop
copilot/fix-venv-activation-issuehttps://github.com/python-mode/python-mode/tree/copilot/fix-venv-activation-issue
Conversation 1 https://github.com/python-mode/python-mode/pull/1200
Commits 5 https://github.com/python-mode/python-mode/pull/1200/commits
Checks 14 https://github.com/python-mode/python-mode/pull/1200/checks
Files changed https://github.com/python-mode/python-mode/pull/1200/files
Please reload this pagehttps://github.com/python-mode/python-mode/pull/1200/files
Make :PymodeRun execute with the activated virtualenv interpreter https://github.com/python-mode/python-mode/pull/1200/files#top
Show all changes 5 commits https://github.com/python-mode/python-mode/pull/1200/files
b875597 Initial plan Copilot Apr 21, 2026 https://github.com/python-mode/python-mode/pull/1200/commits/b875597b7e0d3c2aae9f5b62ea50a830bb741fff
593ac51 fix: run PymodeRun with activated virtualenv interpreter Copilot Apr 21, 2026 https://github.com/python-mode/python-mode/pull/1200/commits/593ac513974326fa8959ad46b7e54187b50d2394
09e2f23 test: normalize expected virtualenv path in run command test Copilot Apr 21, 2026 https://github.com/python-mode/python-mode/pull/1200/commits/09e2f234a444a2c287d6f6b36d391520bb9742e2
892a362 chore: improve subprocess run compatibility and debug logging Copilot Apr 21, 2026 https://github.com/python-mode/python-mode/pull/1200/commits/892a3626d06d1f7c1f4fb4a8924ea6b110e9977a
2aec97c Fix review issues in virtualenv PymodeRun integration diraol May 24, 2026 https://github.com/python-mode/python-mode/pull/1200/commits/2aec97cea6733747af776c139a269f61c9bd485d
Clear filters https://github.com/python-mode/python-mode/pull/1200/files
Please reload this pagehttps://github.com/python-mode/python-mode/pull/1200/files
Please reload this pagehttps://github.com/python-mode/python-mode/pull/1200/files
pymode.txt https://github.com/python-mode/python-mode/pull/1200/files#diff-3585c01cd4fae5a6ed8d84c8be014721f76800019ffaa1b6db6753411bf1c4f9
pymode.vim https://github.com/python-mode/python-mode/pull/1200/files#diff-d87a40e1e5e7a012def966894f2709a0dc568d78be2ca22166147300981640d2
run.py https://github.com/python-mode/python-mode/pull/1200/files#diff-fc37679ccaa6421cd78b9165d71da2656bc3f981c6f531226bccc4f8a57e26a0
commands.vader https://github.com/python-mode/python-mode/pull/1200/files#diff-3f548fb963e8e1fb3e9bc16f7d854fae2149ae1734388a352a0c5a4462c3f613
doc/pymode.txthttps://github.com/python-mode/python-mode/pull/1200/files#diff-3585c01cd4fae5a6ed8d84c8be014721f76800019ffaa1b6db6753411bf1c4f9
View file https://github.com/python-mode/python-mode/blob/2aec97cea6733747af776c139a269f61c9bd485d/doc/pymode.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-mode/python-mode/pull/1200/{{ revealButtonHref }}
https://github.com/python-mode/python-mode/pull/1200/files#diff-3585c01cd4fae5a6ed8d84c8be014721f76800019ffaa1b6db6753411bf1c4f9
https://github.com/python-mode/python-mode/pull/1200/files#diff-3585c01cd4fae5a6ed8d84c8be014721f76800019ffaa1b6db6753411bf1c4f9
plugin/pymode.vimhttps://github.com/python-mode/python-mode/pull/1200/files#diff-d87a40e1e5e7a012def966894f2709a0dc568d78be2ca22166147300981640d2
View file https://github.com/python-mode/python-mode/blob/2aec97cea6733747af776c139a269f61c9bd485d/plugin/pymode.vim
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-mode/python-mode/pull/1200/{{ revealButtonHref }}
https://github.com/python-mode/python-mode/pull/1200/files#diff-d87a40e1e5e7a012def966894f2709a0dc568d78be2ca22166147300981640d2
https://github.com/python-mode/python-mode/pull/1200/files#diff-d87a40e1e5e7a012def966894f2709a0dc568d78be2ca22166147300981640d2
pymode/run.pyhttps://github.com/python-mode/python-mode/pull/1200/files#diff-fc37679ccaa6421cd78b9165d71da2656bc3f981c6f531226bccc4f8a57e26a0
View file https://github.com/python-mode/python-mode/blob/2aec97cea6733747af776c139a269f61c9bd485d/pymode/run.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-mode/python-mode/pull/1200/{{ revealButtonHref }}
https://github.com/python-mode/python-mode/pull/1200/files#diff-fc37679ccaa6421cd78b9165d71da2656bc3f981c6f531226bccc4f8a57e26a0
https://github.com/python-mode/python-mode/pull/1200/files#diff-fc37679ccaa6421cd78b9165d71da2656bc3f981c6f531226bccc4f8a57e26a0
tests/vader/commands.vaderhttps://github.com/python-mode/python-mode/pull/1200/files#diff-3f548fb963e8e1fb3e9bc16f7d854fae2149ae1734388a352a0c5a4462c3f613
View file https://github.com/python-mode/python-mode/blob/2aec97cea6733747af776c139a269f61c9bd485d/tests/vader/commands.vader
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-mode/python-mode/pull/1200/{{ revealButtonHref }}
https://github.com/python-mode/python-mode/pull/1200/files#diff-3f548fb963e8e1fb3e9bc16f7d854fae2149ae1734388a352a0c5a4462c3f613
https://github.com/python-mode/python-mode/pull/1200/files#diff-3f548fb963e8e1fb3e9bc16f7d854fae2149ae1734388a352a0c5a4462c3f613
https://github.com/python-mode/python-mode/pull/1200/files#diff-3f548fb963e8e1fb3e9bc16f7d854fae2149ae1734388a352a0c5a4462c3f613
Please reload this pagehttps://github.com/python-mode/python-mode/pull/1200/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.