[Python-bugs-list] [Bug #131064] sys.path not set correctly in embedded python interpreter.

noreply@sourceforge.net noreply@sourceforge.net
Fri, 23 Feb 2001 03:45:55 -0800


Bug #131064, was updated on 2001-Feb-05 01:54
Here is a current snapshot of the bug.

Project: Python
Category: Windows
Status: Closed
Resolution: Fixed
Bug Group: Platform-specific
Priority: 5
Submitted by: theller
Assigned to : mhammond
Summary: sys.path not set correctly in embedded python interpreter.

Details: sys.path is not set correctly in an embedded python interpreter
under the following conditions:
- win98, win95 (NOT NT or win2000)
- There are no subkeys present in the registry under
HKLM\Software\Python\PythonCore\x.x\PythonPath
  (in other words, win32all is NOT installed)

The call to 
			rc = RegQueryValueEx(newKey, NULL, 0, NULL, 
			                     (LPBYTE)szCur, &dataSize);
in PC\getpathp.c, line 307 fails with error code 234 (More data is
available).
There is no check for an error.
The result is that pythonpath is not zero terminated, and contains
garbage.
The call fails because the buffer size specified in dataSize is one byte
too small.
It does not fail on NT or 2000, because dataSize (as got by the call to
RegQueryInfoKey)
seems to be enough for a UNICODE string.

This bug is also already in Python2.0.


Follow-Ups:

Date: 2001-Feb-23 03:45
By: mhammond

Comment:
Fixed in rev 1.23 of PC/getpath.c.  See patch #103933.
-------------------------------------------------------

Date: 2001-Feb-05 11:52
By: tim_one

Comment:
Assigned to Mark.  Mark, I only skimmed this.  Assigned to you cuz I'll be
out of town the rest of the week.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=131064&group_id=5470