
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-10-09 07:23 bys-wakaba, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| activate | vinay.sajip,2016-02-14 18:04 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3804 | merged | ssbarnea,2017-09-28 15:11 | |
| PR 3820 | merged | python-dev,2017-09-29 12:01 | |
| Messages (8) | |||
|---|---|---|---|
| msg252593 -(view) | Author: (s-wakaba) | Date: 2015-10-09 07:23 | |
When writing bash shellscripts, I always set options "set -ueC" for strict error checking. However, loading pyvenv's activate and deactivate scripts from bash with "-u" option, they are failure because they may refer undefined shell variables.I hope activate script and deactivate function are enclosed like following block_OLD_BASH_OPTIONS="$-"set +u### script body ##set -$_OLD_BASH_OPTIONSunset _OLD_BASH_OPTIONSAnother option, all shell-variables in the script change like$SPAM -> ${SPAM:-} | |||
| msg260284 -(view) | Author: Vinay Sajip (vinay.sajip)*![]() | Date: 2016-02-14 18:04 | |
Can you try the attached script in place of the current activate script and see if it meets the requirements? | |||
| msg303255 -(view) | Author: Sorin Sbarnea (ssbarnea)* | Date: 2017-09-28 15:11 | |
This is a perfectly valid bug and I am surprised it was ignored for so long. I just raised a PR for addressing it, please review it. | |||
| msg303287 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2017-09-28 23:07 | |
Note that in the equivalent issue raised against virtualenv, the concern was raised that some old sh-like shells might not support this syntax, but it was pointed out that it is part of the posix standard. I'm not arguing for or against here, just noting relevant information :)The script comment specifically says "from bash", but presumably the script can be and is sourced from other sh-like shells. | |||
| msg303289 -(view) | Author: Sorin Sbarnea (ssbarnea)* | Date: 2017-09-28 23:42 | |
Based on my tests this worked with all shells I tested with, the syntax being a very old one and not some new/modern one. Passed: bash, zsh, dash, kshPlatforms: MacOS, RHEL LinuxFailed with: tcsh but with the note that even the original code would fail with tcsh anyway. tcsh/csh are not bourne/posix compatible so there is no regression introduced by the the use of "${VAR:-}" syntax.A simple way to test the syntax with enable shell is:SHELLCMD -c 'echo "[${AAA:-}]"' | |||
| msg303325 -(view) | Author: Vinay Sajip (vinay.sajip)*![]() | Date: 2017-09-29 11:48 | |
New changeset90f1d989594f3340c5ffaa2cf9cef1876ac6bb89 by Vinay Sajip (Sorin Sbarnea) in branch 'master':bpo-25351: avoid activate failure on strict shells (GH-3804)https://github.com/python/cpython/commit/90f1d989594f3340c5ffaa2cf9cef1876ac6bb89 | |||
| msg303327 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-09-29 12:34 | |
New changeseta5610e07460a8df4b0923a32d37234cd535ec952 by Victor Stinner (Miss Islington (bot)) in branch '3.6':[3.6]bpo-25351: avoid activate failure on strict shells (GH-3804) (#3820)https://github.com/python/cpython/commit/a5610e07460a8df4b0923a32d37234cd535ec952 | |||
| msg303328 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-09-29 12:35 | |
The bug has been fixed in Python 3.6 and 3.7 (master), thank you Sorin Sbarnea!Python 3.4 and 3.5 don't accept bug fixes anymore, only security fixes:https://devguide.python.org/#status-of-python-branches | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:22 | admin | set | github: 69538 |
| 2017-09-29 12:35:44 | vstinner | set | status: open -> closed versions: + Python 3.6, Python 3.7, - Python 3.4, Python 3.5 messages: +msg303328 resolution: fixed stage: patch review -> resolved |
| 2017-09-29 12:34:45 | vstinner | set | nosy: +vstinner messages: +msg303327 |
| 2017-09-29 12:01:09 | python-dev | set | pull_requests: +pull_request3804 |
| 2017-09-29 11:48:18 | vinay.sajip | set | messages: +msg303325 |
| 2017-09-28 23:42:15 | ssbarnea | set | messages: +msg303289 |
| 2017-09-28 23:07:46 | r.david.murray | set | nosy: +r.david.murray messages: +msg303287 |
| 2017-09-28 15:11:08 | ssbarnea | set | type: enhancement -> behavior versions: + Python 3.4 keywords: +patch nosy: +ssbarnea messages: +msg303255 stage: patch review pull_requests: +pull_request3790 |
| 2016-02-14 18:04:36 | vinay.sajip | set | files: +activate messages: +msg260284 |
| 2016-02-07 06:56:09 | ned.deily | set | nosy: +vinay.sajip |
| 2015-10-09 07:23:57 | s-wakaba | create | |