| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)
Add support.MS_WINDOWS constant (#110446)
(cherry picked from commit e0c44377935de3491b2cbe1e5f87f8b336fdc922)
(cherry picked from commit e188534607761af1f8faba483ce0b1e8578c73e5)
|
|
|
|
| |
of the normal location (GH-100947)
|
|
|
|
| |
contains PYD files instead (GH-98936)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* As most of `test_embed` now uses `Py_InitializeFromConfig`, add
a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`)
* Rename `_testembed` init helper to clarify the API used
* Add a `PyConfig_Clear` call in `Py_InitializeEx` to make
the code more obviously correct (it already didn't leak as
none of the dynamically allocated config fields were being
populated, but it's clearer if the wrappers follow the
documented API usage guidelines)
(cherry picked from commit 05e48865be69e1e5824f6915b588ff054717bb42)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 8fd2c3b75b90c4ee391894aa5094615bbdb6242f)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
|
|
|
|
|
|
| |
command line (GH-28823)" (GH-94745)
(cherry picked from commit aa37ffda29ac48fb2df5a7029ba2e626ecc45850)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
|
|
|
| |
calculation (GH-93641)
(cherry picked from commit 38af903506e9b18c6350c1dadcb489f057713f36)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 96464e5401783c99f1ae24369bb2a854b8c5f46a)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
|
| |
Windows (GH-93888)
(cherry picked from commit ffc228dd4e409336f2c2ad54125de384bf1a767b)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 27185f98fff07b1da84f390f84dc9cbc7c8f0ad5)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the -P command line option and the PYTHONSAFEPATH environment
variable to not prepend a potentially unsafe path to sys.path.
* Add sys.flags.safe_path flag.
* Add PyConfig.safe_path member.
* Programs/_bootstrap_python.c uses config.safe_path=0.
* Update subprocess._optim_args_from_interpreter_flags() to handle
the -P command line option.
* Modules/getpath.py sets safe_path to 1 if a "._pth" file is
present.
|
| |
|
| |
|
|
|
|
| |
PGInstrument on Windows (GH-32083)
|
|
|
|
|
| |
reinitialization (GH-32212)
Automerge-Triggered-By: GH:tiran
|
| |
|
|
|
| |
_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.
|
|
|
| |
Tolerate a leak of 1 reference and 1 memory block until it's fixed.
|
| |
|
| |
|
|
|
|
|
|
| |
* _testembed_Py_Initialize() now uses the PyConfig API, rather than
deprecated Py_SetProgramName().
* Reduce INIT_LOOPS from 16 to 4: test_embed now takes 8.7 seconds
rather than 14.7 seconds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc()
functions to finalize a structseq static type in Py_Finalize().
Currrently, these functions do nothing if Python is built in release
mode.
Clear static types:
* AsyncGenHooksType: sys.set_asyncgen_hooks()
* FlagsType: sys.flags
* FloatInfoType: sys.float_info
* Hash_InfoType: sys.hash_info
* Int_InfoType: sys.int_info
* ThreadInfoType: sys.thread_info
* UnraisableHookArgsType: sys.unraisablehook
* VersionInfoType: sys.version
* WindowsVersionType: sys.getwindowsversion()
|
|
|
|
| |
subprocess (GH-30595)
|
|
|
| |
This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
|
|
|
|
|
| |
The condition is no longer valid. This should resolve the buildbot failure on FreeBSD.
https://bugs.python.org/issue46263
|
|
|
| |
This defines VPATH differently in PGO instrumentation builds, to account for a different default output directory. It also adds sys._vpath on Windows to make the value available to sysconfig so that it can be used in tests.
|
|
|
| |
Also ensures that pybuilddir.txt is written early enough in the build to be picked up by later steps.
|
| |
|
|
|
|
|
| |
The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code.
This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
|
|
|
|
|
|
|
| |
Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and
invert the value.
Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in
PyConfig.code_debug_ranges documentation.
|
| |
|
|
|
|
| |
when stdlib has been installed. (GH-29649)
|
|
|
|
|
| |
In gh-29063 I ended up disabling test_embed on non-Windows by accident. This gets it running again.
https://bugs.python.org/issue45506
|
| |
|
|
|
|
|
| |
We hadn't explicitly added any tests for this, so here they are.
https://bugs.python.org/issue45020
|
|
|
|
|
|
|
| |
(gh-29063)
In gh-28954 I adjusted how test_embed determines if it should be skipped. That broke out-of-tree builds. This change fixes them.
https://bugs.python.org/issue45506
|
|
|
|
|
|
|
| |
(gh-28940)
The default was "off". Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything. There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used.
https://bugs.python.org/issue45020
|
|
|
|
|
| |
The change in gh-28586 (bpo-45211) should not have included code to set _Py_path_config.stdlib_dir in Py_SetPythonHome(). We fix that here.
https://bugs.python.org/issue45471
|
|
|
|
| |
(GH-28823)
|
|
|
|
|
|
|
| |
test_embed.StdPrinterTests now always use the file descriptor 1 for
stdout, rather than using sys.__stdout__.fileno().
PyFile_NewStdPrinter() does crash if the argument is not 1 or 2.
Fix also a few pyflakes warnings: remove unused import and variables.
|
|
|
|
|
| |
Fix typos in the Lib directory as identified by codespell.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
|
| |
During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir.
https://bugs.python.org/issue45211
|
|
|
|
|
|
|
|
|
|
|
|
| |
This accomplishes 2 things:
* consolidates some common code between getpath.c and getpathp.c
* makes the helpers available to code in other files
FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx().
Note that this change is mostly moving code around. No behavior is meant to change.
https://bugs.python.org/issue45211
|
|
|
|
|
|
| |
Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.
Cleanup also test_get_argc_argv().
|
|
|
| |
https://bugs.python.org/issue45020
|
|
|
|
|
|
|
| |
frozen modules. (gh-28320)
Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file. This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now.
https://bugs.python.org/issue45020
|
|
|
|
|
| |
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
|
|
|
|
|
| |
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.
|
| |
|
|
|
|
|
| |
Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to
handle the PYTHONUNBUFFERED environment variable and configure C
stdio streams like stdout (make the stream unbuffered).
|