[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-10-14 Thread Eric Snow


Eric Snow  added the comment:


New changeset 0bbea0723ee07f9d7ad9745f0e1875718ef38715 by Eric Snow in branch 
'main':
bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)
https://github.com/python/cpython/commit/0bbea0723ee07f9d7ad9745f0e1875718ef38715


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-10-14 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +27243
pull_request: https://github.com/python/cpython/pull/28954

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-29 Thread Eric Snow


Eric Snow  added the comment:

Yeah, I was thinking along those lines too but hesitated. :)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Shouldn't we just close the issue and the unused PR? Otherwise we'll just have 
yet another vague bpo issue that doesn't have anything particularly actionable 
-- "there's some code that could be refactored" is not enough of a reason to 
have a bpo issue open, unless it's either a recurring maintenance chore 
(doesn't seem to be the case here) or something that a beginner could easily 
scoop up (definitely not the case here, there are subtleties lurking around 
every corner).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Eric Snow


Eric Snow  added the comment:

I have what I need for now (stdlib dir).  There may be more info to preserve, 
but I'll leave it others to pursue that.

--
assignee: eric.snow -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-28 Thread Eric Snow


Eric Snow  added the comment:


New changeset 0c50b8c0b8274d54d6b71ed7bd21057d3642f138 by Eric Snow in branch 
'main':
bpo-45211: Remember the stdlib dir during startup. (gh-28586)
https://github.com/python/cpython/commit/0c50b8c0b8274d54d6b71ed7bd21057d3642f138


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-27 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +26968
pull_request: https://github.com/python/cpython/pull/28586

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-27 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +26967
pull_request: https://github.com/python/cpython/pull/28585

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-27 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +26966
pull_request: https://github.com/python/cpython/pull/28584

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-27 Thread Eric Snow


Eric Snow  added the comment:


New changeset ae7839bbe817329dd015f9195da308a0f3fbd3e2 by Eric Snow in branch 
'main':
bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)
https://github.com/python/cpython/commit/ae7839bbe817329dd015f9195da308a0f3fbd3e2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-24 Thread Eric Snow


Change by Eric Snow :


--
keywords: +patch
pull_requests: +26933
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28550

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also https://github.com/python/cpython/pull/23169 of bpo-42260 which 
rewrites getpath.c in pure Python.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-15 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-15 Thread Eric Snow


Eric Snow  added the comment:

Setting __file__ on frozen modules is only one example.  I actually need the 
stdlib dir to be preserved for other uses.

FWIW, I think you're probably right about __file__ on frozen modules.  That 
said, further discussion about __file__ (or __path__) is probably more suitable 
in bpo-21736.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Honestly I find it debatable whether we're doing anyone a favor by publishing 
the __file__ of the corresponding stdlib file for frozen modules. There will be 
situations where this points to the wrong file, and editing the file will not 
have an effect (unless you rebuild). I'd rather tell people to use -X 
frozen_modules=off until they can fix their dependency on the __file__ of 
frozen modules.

--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-15 Thread Eric Snow


New submission from Eric Snow :

Currently we calculate a number of filesystem paths during runtime 
initialization in Modules/getpath.c (with the key goal of producing what will 
end up in sys.path).  Some of those paths are preserved and some are not.  In 
cases where the discarded data comes from filesystem access, we should preserve 
as much as possible.

The most notable info is location of the stdlib source files.  We would store 
this as PyConfig.stdlib_dir (and _PyPathConfig.stdlib_dir).  We'd expose it 
with sys.stdlibdir (or sys.get_stdlib_dir() if we might need to calculate 
lazily), similar to sys.platlibdir, sys.home, and sys.prefix.

sys.stdlibdir would allow us to avoid filesystem access, for example:

* in site.py
* in sysconfig.py
* detect if python is running out of the source tree (needed for bpo-45020)

FYI, I have a branch that mostly does what I'm suggesting here.

--
assignee: eric.snow
components: Interpreter Core
messages: 401860
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Useful (expensive) information is discarded in getpath.c.
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com