A comment in the venv `activate` script (as well as `activate.csh` and `activate.fish`) referencing Aspen magic directories lists a "further information" URL for Aspen at the zetadev.com website. zetadev.com changed ownership in 2019, and now redirects to a server in China with an expired security certificate.
Out of an abundance of caution, while not changing the _code_ for the activate scripts, this PR updates the URL in those comments to reference Aspen's new documentation home at https://aspen.io/.
No issue created, as I suspect this falls within the definition of a "trivial" change. Please let me know if I'm wrong about that, and I'll open the necessary issue(s).
While filed against the 3.8 branch, strictly speaking this is not a backported PR. The comment in question was entirely removed from the script between Python 3.8 and 3.9.
(IMHO this _should_ probably be backported to 3.7 and 3.6, as well. I'll happily file those PRs if needed.)
Automerge-Triggered-By: @vsajip
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:
```
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```
(cherry picked from commit 5209e586b7)
Co-authored-by: Daniel Abrahamsson <hamsson@gmail.com>
- Remove use of replacement text in the script
- Make use of the pyvenv.cfg file for prompt value.
- Add parameters to allow more flexibility
- Make use of the current path, and assumptions about where env puts things, to compensate
- Make the script a bit more 'idiomatic' Powershell
- Add script documentation (Get-Help .\.venv\Scripts\Activate.ps1 shows PS help page now
(cherry picked from commit 732775d6be)
Co-authored-by: Derek Keeler <d3r3kk@users.noreply.github.com>
sys._base_executable is now always defined on all platforms, and can be overridden through configuration.
Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.
We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
PowerShell Core 6.1 is the cross-platform port of Windows PowerShell. This change updates Activate.ps1 to not make Windows assumptions as well as installing it into the bin/Scripts directory on all operating systems.
Requires PowerShell Core 6.1 for proper readline support once the shell has been activated for the virtual environment.
This will hopefully make maintenance of venv documentation easier.
For example, see commits a4f0d76af176 and 5764cc02244d.
This patch has been reviewed by Vinaj Sajip, the maintainer of
venv module.