summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner2018-08-0310-67/+75
| | | | sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
* bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)Victor Stinner2018-08-012-12/+2
| | | | | | | | bpo-31650, bpo-34170: Replace _Py_CheckHashBasedPycsMode with _PyCoreConfig._check_hash_pycs_mode. Modify PyInit__imp() and zipimport to get the parameter from the current interpreter core configuration. Remove Include/internal/import.h file.
* bpo-34170: Add Python/coreconfig.c for _PyCoreConfig (GH-8607)Victor Stinner2018-08-015-76/+964
| | | | | | | * Add Include/coreconfig.h * Move config_*() and _PyCoreConfig_*() functions from Modules/main.c to a new Python/coreconfig.c file. * Inline _Py_ReadHashSeed() into config_init_hash_seed() * Move global configuration variables to coreconfig.c
* Define _Py_NO_RETURN for Microsoft C compiler (GH-8606)Victor Stinner2018-08-011-1/+1
|
* bpo-34170: Add _PyCoreConfig._frozen parameter (GH-8591)Victor Stinner2018-08-011-2/+10
| | | Modify frozenmain.c to use _Py_InitializeFromConfig().
* bpo-34113: Fix a crash when using LLTRACE is on (GH-8517)costypetrisor2018-07-311-17/+27
| | | Fix a crash on negative STACKADJ() when Low-Level trace (LLTRACE) is enabled.
* Add docstrings to public methods from context.c (GH-8531)Peter Lamut2018-07-302-17/+79
|
* bpo-34170: Add _Py_InitializeFromConfig() (GH-8454)Victor Stinner2018-07-252-68/+159
| | | | | | | | | | | | | | * If _Py_InitializeCore() is called twice, the second call now copies and apply (partially) the new configuration. * Rename _Py_CommandLineDetails to _PyCmdline * Move more code into pymain_init(). The core configuration created by Py_Main() is new destroyed before running Python to reduce the memory footprint. * _Py_InitializeCore() now returns the created interpreter. _Py_InitializeMainInterpreter() now expects an interpreter. * Remove _Py_InitializeEx_Private(): _freeze_importlib now uses _Py_InitializeFromConfig() * _PyCoreConfig_InitPathConfig() now only computes the path configuration if needed.
* bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)Victor Stinner2018-07-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more fields to _PyCoreConfig: * _check_hash_pycs_mode * bytes_warning * debug * inspect * interactive * legacy_windows_fs_encoding * legacy_windows_stdio * optimization_level * quiet * unbuffered_stdio * user_site_directory * verbose * write_bytecode Changes: * Remove pymain_get_global_config() and pymain_set_global_config() which became useless. These functions have been replaced by _PyCoreConfig_GetGlobalConfig() and _PyCoreConfig_SetGlobalConfig(). * sys.flags.dont_write_bytecode value is now restricted to 1 even if -B option is specified multiple times on the command line. * PyThreadState_Clear() now uses the config from the current interpreter rather than using global Py_VerboseFlag
* bpo-34170: Add _PyCoreConfig.isolated (GH-8417)Victor Stinner2018-07-242-43/+33
| | | | | | | | | | | | | | | * _PyCoreConfig: add isolated and site_import attributes * Replace Py_IgnoreEnvironment with config->ignore_environment when reading the current configuration * _PyCoreConfig_Read() now sets ignore_environment, utf8_mode, isolated and site_import from Py_IgnoreEnvironment, Py_UTF8Mode, Py_IsolatedFlag and Py_NoSiteFlag * _Py_InitializeCore() now sets Py_xxx flags from the configuration * pymain_read_conf() now uses _PyCoreConfig_Copy() to save/restore the configuration. * Rename _disable_importlib of _PyCoreConfig to _install_importlib * _PyCoreConfig_SetGlobalConfig() now also set Py_HashRandomizationFlag * Replace !Py_NoSiteFlag with core_config->site_import
* bpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)Serhiy Storchaka2018-07-241-109/+72
|
* bpo-34149: Behavior of the min/max with key=None (GH-8328)Alexander Marshalov2018-07-241-0/+4
| | | Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().
* bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Serhiy Storchaka2018-07-231-0/+4
| | | | (GH-8262)
* bpo-34190: Fix reference leak in call_function() (GH-8413)jdemeyer2018-07-231-5/+8
|
* bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)Xtreak2018-07-221-4/+4
|
* bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)jdemeyer2018-07-211-4/+10
|
* bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)Victor Stinner2018-07-212-12/+15
| | | | | | | | | | * _PyCoreConfig_Read() no longer directly modifies Py_IsolatedFlag and Py_NoSiteFlag global configuration flags. The function now requires two pointers to integer, so these flags can be set later, to avoid side effets in _PyCoreConfig_Read(). * pathconfig_global_init() now leaves Py_IsolatedFlag and Py_NoSiteFlag unchanged. * Fix pathconfig_global_init(): avoid computing the path configuration twice, use _PyCoreConfig_SetPathConfig().
* bpo-34170: Rework _PyCoreConfig_Read() to avoid side effect (GH-8353)Victor Stinner2018-07-212-28/+311
| | | | | | | | | | | | | | | | | | | | | | | | | Rework _PyCoreConfig_Read() function which *reads* core configuration to not *modify* the path configuration. A new _PyCoreConfig_SetPathConfig() function now recreates the path configuration from the core configuration. This function is now called very late in _Py_InitializeCore(), just before calling initimport(). Changes: * Add _PyCoreConfig.dll_path * Py_SetPath() now fails with a fatal python error on memory allocation failure. * Rename _PyPathConfig_Calculate() to _PyPathConfig_Calculate_impl() * Replace _PyPathConfig_Init() with _PyPathConfig_Calculate(): the function now requires a _PyPathConfig * Add _PyPathConfig_SetGlobal() to set the _Py_path_config global variable. * Add _PyCoreConfig_InitPathConfig(): compute the path configuration * Add _PyCoreConfig_SetPathConfig(): set path configuration from core configuration * Rename wstrlist_append() to _Py_wstrlist_append() * _Py_wstrlist_append() now handles integer overflow.
* bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)Victor Stinner2018-07-201-3/+20
| | | | | Py_Main() can again be called after Py_Initialize(), as in Python 3.6. The new configuration is ignored, except of _PyMainInterpreterConfig.argv which is used to update sys.argv.
* bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)INADA Naoki2018-07-141-0/+2
| | | | | | `_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char. It caused buffer overflow in `_Py_string_to_number_with_underscores()`. This bug is introduced in 9b6c60cb.
* bpo-34080: Fix a memory leak in the compiler. (GH-8222)Serhiy Storchaka2018-07-111-1/+1
|
* bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)Serhiy Storchaka2018-07-111-1/+3
|
* bpo-22689: Copy the result of getenv() in sys_breakpointhook(). (GH-8194)Serhiy Storchaka2018-07-091-1/+14
|
* bpo-34066: Disabled interruption before SETUP_WITH and BEFORE_ASYNC_WITH. ↵Serhiy Storchaka2018-07-091-4/+11
| | | | | | | (GH-8159) This will prevent emitting a resource warning when the execution was interrupted by Ctrl-C between calling open() and entering a 'with' block in "with open()".
* Fix GCC warning in Python/hamt.c (GH-7618)Zackery Spytz2018-07-061-1/+1
|
* bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918)Zackery Spytz2018-07-031-1/+2
| | | | PyErr_Print() will not return when the exception is a SystemExit, so decref the __main__ module object in that case.
* bpo-33985: Implement ContextVar.name attribute. (GH-7980)Yury Selivanov2018-06-281-0/+5
|
* bpo-33451: Close pyc files before calling PyEval_EvalCode() (GH-7884)Zackery Spytz2018-06-241-6/+9
| | | Directly executed pyc files were being kept open longer than necessary.
* bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845)Victor Stinner2018-06-221-0/+5
| | | | Calling Py_Initialize() twice does nothing, instead of failing with a fatal error: restore the Python 3.6 behaviour.
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↵Carl Meyer2018-06-162-1063/+1116
| | | | | | | | | | | | | | | (GH-6834) In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.
* bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)Serhiy Storchaka2018-06-152-4/+4
|
* bpo-33375: Fix GCC warning in Python/_warnings.c (GH-7556)Zackery Spytz2018-06-091-1/+0
| | | _Py_IDENTIFIER(argv) is now unused.
* bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622)Thomas Kluyver2018-06-081-66/+4
| | | More consistent with how other parts of Python find the filename (e.g. tracebacks and pdb).
* bpo-33803: Fix a crash in hamt.c (#7504)Yury Selivanov2018-06-081-0/+2
|
* bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)Steve Dower2018-06-041-1/+7
|
* bpo-31849: Fix warning in pyhash.c (GH-6799)A. Jesse Jiryu Davis2018-06-041-2/+2
|
* bpo-33615: Re-enable a subinterpreter test. (gh-7251)Eric Snow2018-06-021-18/+37
| | | For bpo-32604 I added extra subinterpreter-related tests (see #6914), which caused a few buildbots to crash. This patch fixes the crash by ensuring that refcounts in channels are handled properly.
* bpo-32911: Add the historical note about the magic number. (GH-7273)Serhiy Storchaka2018-05-311-111/+111
|
* bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196)Serhiy Storchaka2018-05-311-1/+2
|
* bpo-33691: Add _PyAST_GetDocString(). (GH-7236)Serhiy Storchaka2018-05-304-58/+43
|
* bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)Serhiy Storchaka2018-05-297-3233/+3189
| | | | | | Remove the docstring attribute of AST types and restore docstring expression as a first stmt in their body. Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-33612: Remove PyThreadState_Clear() assertion (#7069)Victor Stinner2018-05-231-1/+0
| | | | | bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear() which failed at Python shutdown or on fork if a thread was running a generator.
* bpo-23722: Raise a RuntimeError for absent __classcell__. (GH-6931)Serhiy Storchaka2018-05-201-15/+4
| | | A DeprecationWarning was emitted in Python 3.6-3.7.
* bpo-33475: Fix and improve converting annotations to strings. (GH-6774)Serhiy Storchaka2018-05-172-537/+291
|
* bpo-32604: Improve subinterpreter tests. (#6914)Eric Snow2018-05-161-3/+77
| | | Add more tests for subinterpreters. This patch also fixes a few small defects in the channel implementation.
* bpo-33509: Fix _warnings for module_globals=None (#6833)Victor Stinner2018-05-151-1/+8
| | | Don't crash on warnings.warn_explicit() if module_globals is not a dict.
* bpo-33443 Fix typo in Python/import.c (GH-6722)ukwksk2018-05-141-5/+5
|
* fix error message in ast.c (#6776)Jelle Zijlstra2018-05-131-1/+1
| | | small_stmt -> compound_stmt
* bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123)Rolf Eike Beer2018-05-131-13/+13
| | | | | | | The hash implementation casts the input pointer to uint64_t* and directly reads from this, which may cause unaligned accesses. Use memcpy() instead so this code will not crash with SIGBUS on sparc. https://bugs.gentoo.org/show_bug.cgi?id=636400
* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)Victor Stinner2018-04-301-1/+1
| | | | ast.c: fstring_fix_node_location() downcasts a pointer difference to a C int. Replace int with Py_ssize_t to fix the compiler warning.