Issue 10604: Allocating too much memory for pathes (original) (raw)

Issue10604

Created on 2010-12-02 12:32 by danimo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg123067 - (view) Author: Daniel Molkentin (danimo) Date: 2010-12-02 12:32
from PC/getpathp.c:538 if (pythonhome != NULL) { char *p; bufsz = 1; for (p = PYTHONPATH; *p; p++) { if (*p == DELIM) bufsz++; /* number of DELIM plus one */ } bufsz *= strlen(pythonhome); } The second last line should probably read bufsz += strlen(pythonhome);
msg123068 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-12-02 12:40
Hmm, not sure. Try with set PYTHONPATH=.\a;.\b sys.path will contains the entries: <current_dir>\a <current_dir>\b a multiplication seems necessary.
msg123085 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-02 17:35
Before the multiplication, "bufsz" is not aptly named: as your snippet shows it's counting the number of delimiters in the PYTHONPATH.
History
Date User Action Args
2022-04-11 14:57:09 admin set github: 54813
2010-12-02 17:35:40 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + resolution: not a bug
2010-12-02 12:40:50 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2010-12-02 12:32:34 danimo create