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

Windows: document that site is not imported by default by embeddable distribution #73087

Closed
MatthiasvdMeent mannequin opened this issue Dec 8, 2016 · 3 comments
Closed
Labels
docs Documentation in the Doc dir OS-windows type-feature A feature request or enhancement

Comments

@MatthiasvdMeent
Copy link
Mannequin

MatthiasvdMeent mannequin commented Dec 8, 2016

BPO 28901
Nosy @pfmoore, @tjguk, @zware, @zooba, @ethanhs

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-02-05.02:53:55.856>
created_at = <Date 2016-12-08.05:36:04.804>
labels = ['type-feature', 'invalid', 'OS-windows', 'docs']
title = 'Windows: document that site is not imported by default by embeddable distribution'
updated_at = <Date 2020-02-05.02:53:55.855>
user = 'https://bugs.python.org/MatthiasvdMeent'

bugs.python.org fields:

activity = <Date 2020-02-05.02:53:55.855>
actor = 'steve.dower'
assignee = 'docs@python'
closed = True
closed_date = <Date 2020-02-05.02:53:55.856>
closer = 'steve.dower'
components = ['Documentation', 'Windows']
creation = <Date 2016-12-08.05:36:04.804>
creator = 'Matthias v/d Meent'
dependencies = []
files = []
hgrepos = []
issue_num = 28901
keywords = []
message_count = 3.0
messages = ['282693', '282712', '282717']
nosy_count = 7.0
nosy_names = ['paul.moore', 'tim.golden', 'docs@python', 'zach.ware', 'steve.dower', 'Matthias v/d Meent', 'ethan smith']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue28901'
versions = ['Python 3.6']

@MatthiasvdMeent
Copy link
Mannequin Author

MatthiasvdMeent mannequin commented Dec 8, 2016

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

@MatthiasvdMeent MatthiasvdMeent mannequin added docs Documentation in the Doc dir OS-windows type-feature A feature request or enhancement labels Dec 8, 2016
@zware
Copy link
Member

zware commented Dec 8, 2016

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 bpo-28903.

@zware zware changed the title Embedded Release interactive mode documentation Windows: document that site is not imported by default by embeddable distribution Dec 8, 2016
@zooba
Copy link
Member

zooba commented Dec 8, 2016

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).

@zooba zooba closed this as completed Feb 5, 2020
@zooba zooba added the invalid label Feb 5, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir OS-windows type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants