Issue32699
Created on 2018-01-28 18:51 by takluyver, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 5399 | merged | steve.dower, 2018-01-28 22:34 | |
| Messages (6) | |||
|---|---|---|---|
| msg310980 - (view) | Author: Thomas Kluyver (takluyver) * | Date: 2018-01-28 18:51 | |
Nicholas Tollervey has been getting Pynsist to use the new pythonXY._pth file to assemble sys.path. However, I'm not clear on how this behaves with .pth files. The docs on this (https://docs.python.org/3/using/windows.html#finding-modules ) appear to contradict themselves: > site is not imported unless one line in the file specifies import site > ... > Note that .pth files (without leading underscore) will be processed normally by the site module. I can see two possibilities: 1. .pth files are processed normally if and only if the ._pth file specifies 'import site'. If it doesn't, they are ignored. 2. If a .pth file is encountered, site is imported to process it, but with sys.flags.nosite set, so that site doesn't do the normal stuff on import. Some packages unfortunately seem to depend on .pth files getting processed, so if 1. is the case, Pynsist needs to ensure site is loaded. Thanks :-) |
|||
| msg311005 - (view) | Author: Steve Dower (steve.dower) * ![]() |
Date: 2018-01-28 21:39 | |
1 is correct. I don't see the contradiction - maybe you could purpose a rewording? (Perhaps it currently relies on the knowledge that the site module finds and processes .pth files? -S will also suppress it.) |
|||
| msg311012 - (view) | Author: Thomas Kluyver (takluyver) * | Date: 2018-01-28 22:08 | |
I'd reword the second sentence like this: > Note that .pth files (without leading underscore) will be processed only if this file specifies ``import site``. The current wording sounds (to me) like a guarantee that .pth files will still be handled, despite the other things that this mechanism switches off. |
|||
| msg311032 - (view) | Author: Steve Dower (steve.dower) * ![]() |
Date: 2018-01-28 23:34 | |
New changeset 15ea3a6a320623328530e5d8da5b83c75766180b by Steve Dower in branch 'master': bpo-32699: Improves doc for .pth files in presense of a ._pth file (#5399) https://github.com/python/cpython/commit/15ea3a6a320623328530e5d8da5b83c75766180b |
|||
| msg311043 - (view) | Author: Steve Dower (steve.dower) * ![]() |
Date: 2018-01-29 03:22 | |
Hopefully that's enough of a clarification. |
|||
| msg311079 - (view) | Author: Thomas Kluyver (takluyver) * | Date: 2018-01-29 08:17 | |
Thanks Steve, that looks good. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:57 | admin | set | github: 76880 |
| 2018-01-29 08:17:38 | takluyver | set | messages: + msg311079 |
| 2018-01-29 03:22:16 | steve.dower | set | status: open -> closed resolution: fixed assignee: docs@python |
| 2018-01-28 23:34:11 | steve.dower | set | messages: + msg311032 |
| 2018-01-28 22:34:36 | steve.dower | set | keywords:
+ patch stage: patch review pull_requests: + pull_request5233 |
| 2018-01-28 22:08:09 | takluyver | set | messages: + msg311012 |
| 2018-01-28 21:42:01 | barry | set | nosy:
+ barry |
| 2018-01-28 21:39:31 | steve.dower | set | messages: + msg311005 |
| 2018-01-28 18:51:50 | takluyver | create | |
