This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Windows: document that site is not imported by default by embeddable distribution
Type: enhancement Stage: resolved
Components: Documentation, Windows Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Matthias v/d Meent, docs@python, ethan smith, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2016-12-08 05:36 by Matthias v/d Meent, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg282693 - (view) Author: Matthias v/d Meent (Matthias v/d Meent) Date: 2016-12-08 05:36
The Windows Embedded release (at least the x86_64 version) does not include the usual helper functions (exit, help, ...) when run interactively (~ python.exe). This is not documented at the docs of Windows Embedded release, which might mean that this is a bug.

Documentation on Embedded release here (https://docs.python.org/3/using/windows.html#embedded-distribution)

missing in interactive mode of embedded release: (output of diff):
['copyright', 'credits', 'exit', 'help', 'license', 'quit']

Notice that 'help', a builtin function according to the docs [0], is missing in the Embedded release. Even when embedded, a builtin should be available IMO.


[0] https://docs.python.org/3.6/library/functions.html

This comparison was only between running the python executable in the [zip] and python installed from this [installer]. It is very well possible this is a long-standing issue since 3.5 (the first Embedded release), and this may occur on other architectures as well.

[zip] https://www.python.org/ftp/python/3.6.0/python-3.6.0rc1-embed-amd64.zip 
[installer] https://www.python.org/ftp/python/3.6.0/python-3.6.0rc1-amd64.exe
msg282712 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-12-08 15:29
Each of those items is added to builtins by site.py, which I believe is not imported by default by the embeddable distribution.  I didn't immediately find that fact mentioned in the docs, though.

Also note that the embeddable distribution isn't really meant for regular usage, it's meant for embedding :).  While this is definitely worth some clarification in the docs, it's not a high-priority issue.

+Ethan Smith from #28903.
msg282717 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-12-08 16:32
If you go to the 3.6 version of that doc page and also read the section on finding modules, you'll see that the presence of a "python._pth" file causes -S (skip importing site) to be implied unless the ._pth file includes "import site":

https://docs.python.org/3.6/using/windows.html#finding-modules

You'll then notice that the embeddable distro includes a ._pth file by default (though you don't have to distribute that with your app, just as you may want to omit the exe files). That could certainly be called out more clearly in the section on the embeddable distro, though so far it hasn't come up with anyone who's using it for its proper purpose (that I'm aware of).
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73087
2020-02-05 02:53:55steve.dowersetstatus: open -> closed
resolution: not a bug
stage: needs patch -> resolved
2016-12-08 16:32:23steve.dowersetmessages: + msg282717
2016-12-08 15:29:20zach.waresetnosy: + ethan smith
title: Embedded Release interactive mode documentation -> Windows: document that site is not imported by default by embeddable distribution
messages: + msg282712

stage: needs patch
2016-12-08 15:27:19zach.warelinkissue28903 superseder
2016-12-08 05:36:04Matthias v/d Meentcreate