Message333116
From the error I think the quotes are not properly escaped while doing text replacement in venv activate file template at [0] while it's generated? On linux/Mac double quotes are used and hence the error is not triggered with single quote in virtualenv name. Using double quote in virtualenv name triggers the parse error.
$ python3.7 -m venv py37\"-bpo-35667-venv
$ source py37\"-bpo-35667-venv/bin/activate
py37"-bpo-35667-venv/bin/activate:57: parse error near `then'
Looking into the py37\"-bpo-35667-venv/bin/activate script there is below line where the double quote is unbalanced :
if [ "x(py37"-bpo-35667-venv) " != x ] ; then
PS1="(py37"-bpo-35667-venv) ${PS1:-}"
else
I tried escaping the quotes with backslash at [0] but I get a similar error. I guess it's similar case in Powershell as I can see from Activate.ps1 but I haven't tested it. I am not sure about the difference in semantics between powershell and command prompt with respect to quoting since I don't have access to Windows.
py37\'-bpo-35667-venv/bin/Activate.ps1 file with unbalanced quote
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green '(py37'-bpo-35667-venv) '
_OLD_VIRTUAL_PROMPT
}
[0] https://github.com/python/cpython/blob/a5b76167dedf4d15211a216c3ca7b98e3cec33b8/Lib/venv/__init__.py#L280 |
|
Date |
User |
Action |
Args |
2019-01-06 18:17:41 | xtreak | set | recipients:
+ xtreak, vinay.sajip, cheryl.sabella |
2019-01-06 18:17:40 | xtreak | set | messageid: <1546798660.09.0.381551090002.issue35667@roundup.psfhosted.org> |
2019-01-06 18:17:40 | xtreak | link | issue35667 messages |
2019-01-06 18:17:39 | xtreak | create | |
|