[Python-Dev] r85028 - in python/branches/py3k: Doc/c-api/init.rst Include/pythonrun.h Modules/getpath.c PC/getpathp.c

Lisandro Dalcin dalcinl at gmail.com
Wed Sep 29 19:43:10 CEST 2010


On 27 September 2010 11:57, Georg Brandl <g.brandl at gmx.net> wrote:
> Am 27.09.2010 07:32, schrieb kristjan.jonsson:
>> Author: kristjan.jonsson
>> Date: Mon Sep 27 07:32:54 2010
>> New Revision: 85028
>>
>> Log:
>> issue 9910
>> Add a Py_SetPath api to override magic path computations when starting up python.
>>
>> Modified:
>>    python/branches/py3k/Doc/c-api/init.rst
>>    python/branches/py3k/Include/pythonrun.h
>>    python/branches/py3k/Modules/getpath.c
>>    python/branches/py3k/PC/getpathp.c
>>
>> Modified: python/branches/py3k/Doc/c-api/init.rst
>
>> +.. cfunction::  void Py_SetPath(const wchar_t *)
>> +
>> +   .. index::
>> +      triple: module; search; path
>> +      single: path (in module sys)
>> +      single: Py_GetPath()
>> +
>> +   Set the default module search path.  If this function is called before
>> +   :cfunc: `Py_Initialize` then :cfunc: Py_GetPath won't attempt to compute
>> +   a default serarch path but uses the provided one in stead.  This is useful
>> +   if Python is being embedded by an application that has full knowledge
>> +   of the location of all modules.  The path components should be separated
>> +   by semicolons.
>> +
>> +   This also causes `sys.executable` to be set only to the raw program name
>> +   (see :cfunc:`Py_SetProgramName`) and `for sys.prefix` and
>> +   `sys.exec_prefix` to be empty.  It is up to the caller to modify these if
>> +   required after calling :cfunc: `Py_Initialize`.
>> +
>
> This needs a versionadded.
>
> Georg
>

Did you noticed " ... The path components should be separated by
semicolons." ? I would expect os.path.pathsep, after all paths are not
OS-independent.


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169


More information about the Python-Dev mailing list