| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* calculate_path() rewritten in Modules/getpath.c and PC/getpathp.c
* Move global variables into a new PyPathConfig structure.
* calculate_path():
* Split the huge calculate_path() function into subfunctions.
* Add PyCalculatePath structure to pass data between subfunctions.
* Document PyCalculatePath fields.
* Move cleanup code into a new calculate_free() subfunction
* calculate_init() now handles Py_DecodeLocale() failures properly
* calculate_path() is now atomic: only replace PyPathConfig
(path_config) at once on success.
* _Py_GetPythonHomeWithConfig() now returns an error on failure
* Add _Py_INIT_NO_MEMORY() helper: report a memory allocation failure
* Coding style fixes (PEP 7)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Py_Main() now reads the PYTHONHOME environment variable
* Add _Py_GetPythonHomeWithConfig() private function
* Add _PyWarnings_InitWithConfig()
* init_filters() doesn't get the current core configuration from the
current interpreter or Python thread anymore. Pass explicitly the
configuration to _PyWarnings_InitWithConfig().
* _Py_InitializeCore() now fails on _PyWarnings_InitWithConfig()
failure.
* Pass configuration as constant
|
|
|
|
| |
Move _PyCoreConfig.module_search_path_env to _PyMainInterpreterConfig
structure.
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
* Py_Main() initializes _PyCoreConfig.module_search_path_env from
the PYTHONPATH environment variable.
* PyInterpreterState_New() now initializes core_config and config
fields
* Compute sys.path a little bit ealier in
_Py_InitializeMainInterpreter() and new_interpreter()
* Add _Py_GetPathWithConfig() private function.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a memory corruption in getpath.c due to mixed memory allocators
between Py_GetPath() and Py_SetPath().
The fix use the Raw allocator to mimic the windows version.
This patch should be used from python3.6 to the current version
for more details, see the bug report and
https://github.com/pyinstaller/pyinstaller/issues/2812
|
|\
| |
| |
| |
| | |
empty compile-time PYTHONPATH components. This fixes some tests in -S or -I
modes.
|
| |
| |
| |
| |
| | |
empty compile-time PYTHONPATH components. This fixes some tests in -S or -I
modes.
|
|\ \
| |/ |
|
| | |
|
|/ |
|
|
|
|
|
|
| |
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
|
|
|
|
|
|
|
| |
I expected more users of _Py_wstat(), but in practice it's only used by
Modules/getpath.c. Move the function because it's not needed on Windows.
Windows uses PC/getpathp.c which uses the Win32 API (ex: GetFileAttributesW())
not the POSIX API.
|
|\
| |
| |
| | |
overflows. Added few missed PyErr_NoMemory().
|
| |
| |
| |
| | |
overflows. Added few missed PyErr_NoMemory().
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
directory to sys.path when running from a build directory. That has
proven to be problematic for several standard library modules with
C extension modules whose builds can fail on some platforms.
|
|/
|
|
|
| |
``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these
functions.
|
|
|
|
| |
Original patch by Thomas Wouters.
|
| |
|
|
|
|
| |
for module_search_path. It was already the case on _Py_char2wchar() failure.
|
|
|
|
|
|
|
| |
_Py_char2wchar() to decode lib_python instead.
Some compilers don't support concatenating literals: L"wide" "bytes". Example:
IRIX compiler.
|
|\
| |
| |
| | |
prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
|
| |
| |
| |
| | |
prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
|
| |
| |
| |
| |
| |
| |
| | |
* Replace malloc() with PyMem_RawMalloc()
* Replace PyMem_Malloc() with PyMem_RawMalloc() where the GIL is not held.
* _Py_char2wchar() now returns a buffer allocated by PyMem_RawMalloc(), instead
of PyMem_Malloc()
|
|/
|
|
|
|
| |
all.
Thanks to Armin Rigo and Alexey Kachayev.
|
|
|
|
| |
Patch by Ronald Oussoren.
|
| |
|
|
|
|
|
|
| |
encoding using _Py_char2wchar() instead of mbstowcs() to store undecodable
bytes as surrogates characters (PEP 383) instead of ignoring silently
the PYTHONPATH variable.
|
|
|
|
| |
possible crash when calling Py_SetPath()
|
| |
|
|
|
|
|
|
| |
PyUnicode_AsWideChar() result is signed, whereas it was stored in a unsigned
variable, and then the test was "n >= 0" which is always true to an unsigned
number. Patch written by Hallvard B Furuseth.
|
|
|
|
|
| |
_Py_char2wchar(), instead of L"" VAR hack, to escape undecodable bytes using
the surrogateescape error handler.
|
|
|
|
|
|
| |
Instead of casting it to wchar_t* without conversion. It fixes a bug if Python
is compiled a non-ascii directory, different than the source code directory,
with C locale.
|
|
|
|
| |
path value may be changed, so keep a copy in a new variable.
|
|
|
|
| |
to support surrogate characters
|
| |
|
|
|
|
|
| |
.. instead of raising a fatal error. Even if the current directory was deleted,
use relative paths may still work (eg. run Python with "../python").
|
| |
|
|
|
|
|
|
|
| |
* _Py_fopen() and _Py_stat() come from Python/import.c
* (_Py)_wrealpath() comes from Python/sysmodule.c
* _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c
* (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c
|
|
|
|
| |
Use _Py_wchar2char() to support surrogate characters in the input path.
|
|
|
|
| |
Add a Py_SetPath api to override magic path computations when starting up python.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* Use _Py_wchar2char() in _wstat() and _Py_wfopen()
* Document _Py_char2wchar()
|
|
|
|
|
| |
at interpreter startup before importing any non-builtin modules.
Should fix #9589.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on OSX. This fixes a small issue that was exposed
by running test_subprocess through regrtest (and
hence in a subdirectory).
Without this patch running python.exe from the
build tree will fail when these tree conditions
are true:
1) the CWD is not the root of build tree
2) python.exe is found through $PATH
3) the framework is not yet installed
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78835 | victor.stinner | 2010-03-11 13:34:39 +0100 (jeu., 11 mars 2010) | 7 lines
Issue #7774: Set sys.executable to an empty string if argv[0] has been
set to an non existent program name and Python is unable to retrieve the real
program name.
Fix also sysconfig: if sys.executable is an empty string, use the current
working directory.
........
r78836 | victor.stinner | 2010-03-11 14:27:35 +0100 (jeu., 11 mars 2010) | 4 lines
Fix test_executable introduce in previous commit (r78835): Windows is able to
retrieve the absolute Python path even if argv[0] has been set to a non
existent program name.
........
r78837 | victor.stinner | 2010-03-11 14:46:06 +0100 (jeu., 11 mars 2010) | 3 lines
Another fix to test_executable() of test_sys: set the current working to avoid
the #7774 bug.
........
|