| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
| |
Closes bpo-15873.
|
|
|
|
| |
newline (GH-2343)
|
|
|
|
|
|
|
|
|
| |
* _Py_InitializeCore() doesn't call _PyMem_SetupAllocators() anymore
if the PYTHONMALLOC environment variable is not set.
* pymain_cmdline() now sets the allocator to the default, instead of
setting the allocator in subfunctions.
* Py_SetStandardStreamEncoding() now calls
_PyMem_SetDefaultAllocator() to get a known allocator, to be able
to release the memory with the same allocator.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Add _PyCoreConfig.install_signal_handlers
* Remove _PyMain.config: _PyMainInterpreterConfig usage is now
restricted to pymain_init_python_main().
* Rename _PyMain.core_config to _PyMain.config
* _PyMainInterpreterConfig_Read() now creates the xoptions dictionary
from the core config
* Fix _PyMainInterpreterConfig_Read(): don't replace xoptions and
argv if they are already set.
|
|
|
|
|
| |
* Make ssh_handshake_timeout None by default.
* Raise ValueError if ssl_handshake_timeout is used without ssl.
* Raise ValueError if ssl_handshake_timeout is not positive.
|
|
|
| |
The built-in map() function collects function arguments lazily, but concurrent.futures.Executor.map() does so eagerly.
|
|
|
| |
Use tuples and raw arrays instead of lists.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merge _PyCoreConfig_ReadEnv() into _PyCoreConfig_Read(), and
_Py_CommandLineDetails usage is now restricted to pymain_cmdline().
Changes:
* _PyCoreConfig: Add nxoption, xoptions, nwarnoption and warnoptions
* Add _PyCoreConfig.program: argv[0] or ""
* Move filename, command, module and xoptions from
_Py_CommandLineDetails to _PyMain. xoptions _Py_OptList becomes
(int, wchar_t**) list.
* Add pymain_cmdline() function
* Rename copy_argv() to copy_wstrlist(). Rename clear_argv() to
clear_wstrlist(). Remove _Py_OptList structure: use (int,
wchar_t**) list instead.
* Rename pymain_set_flag_from_env() to pymain_get_env_flag()
* Rename pymain_set_flags_from_env() to pymain_get_env_flags()
* _PyMainInterpreterConfig_Read() now creates the warnoptions from
_PyCoreConfig.warnoptions
* Inline pymain_add_warning_dev_mode() and
pymain_add_warning_bytes_flag() into config_init_warnoptions()
* Inline pymain_get_program_name() into _PyCoreConfig_Read()
* _Py_CommandLineDetails: Replace warning_options with nwarnoption
and warnoptions. Replace env_warning_options with nenv_warnoption
and env_warnoptions.
* pymain_warnings_envvar() now has a single implementation for
Windows and Unix: use config_get_env_var_dup() to also get the
variable as wchar_t* on Unix.
|
|
|
|
| |
* bpo-32379: Faster MRO computation for single inheritance
|
|
|
|
| |
Change atexit behavior and PEP-489 multiphase init support.
|
|
|
|
|
|
|
| |
* Reorganize pymain_main() to make the code more flat
* Clear configurations before pymain_update_sys_path()
* Mark Py_FatalError() and _Py_FatalInitError() with _Py_NO_RETURN
* Replace _PyMain.run_code variable with a new RUN_CODE() macro
* Move _PyMain.cf into a local variable in pymain_run_python()
|
|
|
|
|
|
|
| |
* Add argc and argv to _PyCoreConfig
* _PyMainInterpreterConfig_Read() now builds its argv from
_PyCoreConfig.arg
* Move _PyMain.env_warning_options into _Py_CommandLineDetails
* Reorder pymain_free()
|
|
|
|
| |
Mention that the format-specifier mini language in f-strings
is the same one used by str.format.
|
|
|
|
| |
10 seconds by default.
|
|
|
|
|
|
| |
* Fix #32377: improve __del__ docs and fix mention about resurrection
* Mention that CPython only calls __del__ once.
|
| |
|
|
|
|
|
| |
Implement find_library() support in ctypes/util for AIX.
Add some AIX specific tests.
|
| |
|
| |
|
| |
|
|
|
|
| |
Recent sock.type fix (see bug 32331) makes sock.type checks simpler
in asyncio.
|
|
|
|
|
|
|
|
|
|
|
| |
Fix compiler warnings in Py_FinalizeEx(): only define variables if
they are needed, add #ifdef.
Other cleanup changes:
* _PyWarnings_InitWithConfig() is no more needed: call
_PyWarnings_Init() instead.
* Inline pymain_init_main_interpreter() in its caller. This
subfunction is no more justifed.
|
| |
|
| |
|
|
|
|
|
| |
* main.c: add missing #include <fenv.h> on FreeBSD
* indent also other #ifdef in main.c
* cleanup Programs/python.c
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The last part of test_close_fds() doesn't match its own comment.
The following assertion always holds because fds_to_keep and open_fds
are disjoint by construction.
self.assertFalse(remaining_fds & fds_to_keep & open_fds,
"Some fds not in pass_fds were left open")
Fix the code to match the message in the assertion.
|
| |
|
|
|
| |
It was introduced in bpo-27169.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows (#1218)
Even though Python marks any handles it opens as non-inheritable there
is still a race when using `subprocess.Popen` since creating a process
with redirected stdio requires temporarily creating inheritable handles.
By implementing support for `subprocess.Popen(close_fds=True)` we fix
this race.
In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST
which is available since Windows Vista. Which allows to pass an explicit
list of handles to inherit when creating a process.
This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]`
which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST
directly.
|
|
|
|
|
|
|
|
|
|
| |
Constant folding was moved to AST optimizer.
But compiler may emit LOAD_CONSTs + BUILD_TUPLE.
For example, default arguments can be constant tuple
if all arguments are constant.
This commit makes peephole's tuple folding simple.
It doesn't support nested tuples because nested
tuples are folded by AST optimizer already.
|
| |
|
| |
|
|
|
| |
bpo-32264
|
|
|
|
|
|
| |
* Use fastpath in asyncio.sleep if delay<0
* Add NEWS entry
|
| |
|
| |
|
|
|
| |
Based on tests from #4878
|
|
|
|
|
|
|
|
|
|
| |
Exactly which locale requests will end up giving
you the "C" locale is actually platform dependent.
A blank locale and "POSIX" will translate to "C"
on most Linux distros, but may not do so on other platforms, so this adjusts the way the tests are structured to better account for that.
This is an initial step towards fixing the current
test failure on Cygwin (hence the issue reference)
|
|
|
|
|
|
|
|
|
|
| |
As a result of 92a3c6f493ad411e4cf0acdf305ef4876aa90669, the compiler complains:
Python/import.c:2311:21: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This overflow is extremely unlikely to happen, but let's avoid undefined
behavior anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-29240, bpo-32030: If the encoding change (C locale coerced or
UTF-8 Mode changed), Py_Main() now reads again the configuration with
the new encoding.
Changes:
* Add _Py_UnixMain() called by main().
* Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be
called multipled times.
* Rename pymain_parse_cmdline_envvars() to pymain_read_conf().
* Py_Main() now clears orig_argc and orig_argv at exit.
* Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is
no need anymore to get two copies of the wchar_t** argv.
* _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn.
* Py_UTF8Mode is now initialized to -1.
* Locale coercion (PEP 538) now respects -I and -E options.
|
| |
|
| |
|
|
|
| |
Don't define decode_locale() nor encode_locale() on macOS or Android.
|
| |
|
|
|
| |
Link to the Format Specification Mini Language section from f-strings' documentation.
|
|
|
|
| |
Run the child process with -E option to ignore the PYTHONWARNINGS
environment variable.
|