Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-33922: Adding documentation for new "-64" suffix of python launcher #7849

Merged
merged 1 commit into from Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 23 additions & 13 deletions Doc/using/windows.rst
Expand Up @@ -154,7 +154,9 @@ of available options is shown below.
| DefaultJustForMeTargetDir | The default install directory for | :file:`%LocalAppData%\\\ |
| | just-for-me installs | Programs\\PythonXY` or |
| | | :file:`%LocalAppData%\\\ |
| | | Programs\\PythonXY-32` |
| | | Programs\\PythonXY-32` or|
| | | :file:`%LocalAppData%\\\ |
| | | Programs\\PythonXY-64` |
+---------------------------+--------------------------------------+--------------------------+
| DefaultCustomTargetDir | The default custom install directory | (empty) |
| | displayed in the UI | |
Expand Down Expand Up @@ -762,9 +764,16 @@ on Windows which you hope will be useful on Unix, you should use one of the
shebang lines starting with ``/usr``.

Any of the above virtual commands can be suffixed with an explicit version
(either just the major version, or the major and minor version) - for example
``/usr/bin/python2.7`` - which will cause that specific version to be located
and used.
(either just the major version, or the major and minor version).
Furthermore the 32-bit version can be requested by adding "-32" after the
minor version. I.e. ``/usr/bin/python2.7-32`` will request usage of the
32-bit python 2.7.

.. versionadded:: 3.7

Beginning with python launcher 3.7 it is possible to request 64-bit version
by the "-64" suffix. Furthermore it is possible to specify a major and
architecture without minor (i.e. ``/usr/bin/python3-64``).

The ``/usr/bin/env`` form of shebang line has one further special property.
Before looking for installed Python interpreters, this form will search the
Expand Down Expand Up @@ -806,17 +815,18 @@ Customizing default Python versions
In some cases, a version qualifier can be included in a command to dictate
which version of Python will be used by the command. A version qualifier
starts with a major version number and can optionally be followed by a period
('.') and a minor version specifier. If the minor qualifier is specified, it
may optionally be followed by "-32" to indicate the 32-bit implementation of
that version be used.
('.') and a minor version specifier. Furthermore it is possible to specifiy
mrh1997 marked this conversation as resolved.
Show resolved Hide resolved
if a 32 or 64 bit implementation shall be requested by adding "-32" or "-64".

For example, a shebang line of ``#!python`` has no version qualifier, while
``#!python3`` has a version qualifier which specifies only a major version.

If no version qualifiers are found in a command, the environment variable
``PY_PYTHON`` can be set to specify the default version qualifier - the default
value is "2". Note this value could specify just a major version (e.g. "2") or
a major.minor qualifier (e.g. "2.6"), or even major.minor-32.
If no version qualifiers are found in a command, the environment
variable :envvar:`PY_PYTHON` can be set to specify the default version
qualifier. If it is not set, the default is "3". The variable can
specify any value that may be passed on the command line, such as "3",
"3.7", "3.7-32" or "3.7-64". (Note that the "-64" option is only
available with the launcher included with Python 3.7 or newer.)

If no minor version qualifiers are found, the environment variable
``PY_PYTHON{major}`` (where ``{major}`` is the current major version qualifier
Expand All @@ -834,8 +844,8 @@ of the specified version if available. This is so the behavior of the launcher
can be predicted knowing only what versions are installed on the PC and
without regard to the order in which they were installed (i.e., without knowing
whether a 32 or 64-bit version of Python and corresponding launcher was
installed last). As noted above, an optional "-32" suffix can be used on a
version specifier to change this behaviour.
installed last). As noted above, an optional "-32" or "-64" suffix can be
used on a version specifier to change this behaviour.

Examples:

Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Expand Up @@ -723,6 +723,7 @@ Ludwig Hähne
Gerhard Häring
Fredrik Håård
Florian Höch
Robert Hölzl
Catalin Iacob
Mihai Ibanescu
Ali Ikinci
Expand Down