https://github.com/python/cpython/commit/9aa85f524fd276becc2a4265a9b0c00b4e7b3440
commit: 9aa85f524fd276becc2a4265a9b0c00b4e7b3440
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: brettcannon <[email protected]>
date: 2024-10-10T17:39:39Z
summary:

[3.13] gh-122765: make prompt in activate.csh robust against unbalanced quotes 
and newlines (GH-123751) (GH-124185)

gh-122765: make prompt in activate.csh robust against unbalanced quotes and 
newlines (GH-123751)
(cherry picked from commit a15a584bf3f94ea11ab9363548c8872251364000)

Co-authored-by: Jacek <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>

files:
A Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst
M Lib/venv/scripts/posix/activate.csh

diff --git a/Lib/venv/scripts/posix/activate.csh 
b/Lib/venv/scripts/posix/activate.csh
index c707f1988b0acc..b5db4a0f847e06 100644
--- a/Lib/venv/scripts/posix/activate.csh
+++ b/Lib/venv/scripts/posix/activate.csh
@@ -19,7 +19,7 @@ setenv VIRTUAL_ENV_PROMPT "__VENV_PROMPT__"
 set _OLD_VIRTUAL_PROMPT="$prompt"
 
 if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
-    set prompt = "(__VENV_PROMPT__) $prompt"
+    set prompt = "(__VENV_PROMPT__) $prompt:q"
 endif
 
 alias pydoc python -m pydoc
diff --git 
a/Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst 
b/Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst
new file mode 100644
index 00000000000000..8a1bc4bce81d76
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-09-06-00-00-43.gh-issue-122765.tx4hsr.rst
@@ -0,0 +1 @@
+Fix unbalanced quote errors occurring when activate.csh in :mod:`venv` was 
sourced with a custom prompt containing unpaired quotes or newlines.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to