summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33128 Fix duplicated call to importlib._install_external_importers ↵Pablo Galindo2018-04-251-0/+3
| | | | | | | | | (GH-6273) External importers were being added in both phases of the import system initialisation. They're only supposed to be added in the second phase, after the import machinery has been appropriately configured.
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-32101: Add PYTHONDEVMODE environment variable (#4624)Victor Stinner2017-11-301-2/+4
| | | | | | * bpo-32101: Add sys.flags.dev_mode flag Rename also the "Developer mode" to the "Development mode". * bpo-32101: Add PYTHONDEVMODE environment variable Mention it in the development chapiter.
* bpo-32030: Rework memory allocators (#4625)Victor Stinner2017-11-291-1/+8
| | | | | | | | | | | | | | | | | | | | * Fix _PyMem_SetupAllocators("debug"): always restore allocators to the defaults, rather than only caling _PyMem_SetupDebugHooks(). * Add _PyMem_SetDefaultAllocator() helper to set the "default" allocator. * Add _PyMem_GetAllocatorsName(): get the name of the allocators * main() now uses debug hooks on memory allocators if Py_DEBUG is defined, rather than calling directly malloc() * Document default memory allocators in C API documentation * _Py_InitializeCore() now fails with a fatal user error if PYTHONMALLOC value is an unknown memory allocator, instead of failing with a fatal internal error. * Add new tests on the PYTHONMALLOC environment variable * Add support.with_pymalloc() * Add the _testcapi.WITH_PYMALLOC constant and expose it as support.with_pymalloc(). * sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so replace it with support.with_pymalloc(). * pythoninfo: add _testcapi collector for pymem
* bpo-31949: Fixed several issues in printing tracebacks ↵Serhiy Storchaka2017-11-151-0/+33
| | | | | | | | | | | | (PyTraceBack_Print()). (#4289) * Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks. * Setting sys.tracebacklimit to None now causes using the default limit. * Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit. * Fixed integer overflows in the case of more than 2**31 traceback items on Windows. * Fixed output errors handling.
* Fix the sizeof test for dicts with shared keys. (#4311)Serhiy Storchaka2017-11-071-5/+10
| | | | By accident the size of the empty dict keys object matched the size of values array.
* Move exc state to generator. Fixes bpo-25612 (#1773)Mark Shannon2017-10-221-2/+2
| | | Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-1/+1
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-30/+2
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-28180: Implementation for PEP 538 (#659)Nick Coghlan2017-06-111-0/+1
| | | | | | | | | | - new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time
* bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168)Dong-hee Na2017-04-201-3/+5
|
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+0
| | | Make also minor PEP8 coding style fixes on modified imports.
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-0/+3
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-161-1/+1
| | | | collections.namedtuple() now supports tuples with more than 255 elements.
* Add sys.getandroidapilevel()Victor Stinner2016-12-021-0/+7
| | | | | | | Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
* Try to fix sizeof unit tests on dictVictor Stinner2016-09-101-3/+3
| | | | Issue #28056 and issue #26058.
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-091-0/+26
|
* Issue #24254: Drop cls.__definition_order__.Eric Snow2016-09-081-1/+1
|
* Add a new private version to the builtin dict typeVictor Stinner2016-09-081-3/+3
| | | | | | | Issue #26058: Add a new private version to the builtin dict type, incremented at each dictionary creation and at each dictionary change. Implementation of the PEP 509.
* Fixes tests broken by issue #27781.Steve Dower2016-09-081-2/+3
|
* Implement compact dictVictor Stinner2016-09-081-5/+5
| | | | | | | | | | | | Issue #27350: `dict` implementation is changed like PyPy. It is more compact and preserves insertion order. _PyDict_Dummy() function has been removed. Disable test_gdb: python-gdb.py is not updated yet to the new structure of compact dictionaries (issue #28023). Patch written by INADA Naoki.
* fix expected layout of code objectsBenjamin Peterson2016-09-071-3/+3
|
* Issue #24254: Preserve class attribute definition order.Eric Snow2016-09-051-1/+1
|
* Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-2/+6
|
* Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
|
* Issue #25339: PYTHONIOENCODING now has priority over locale in setting theSerhiy Storchaka2016-04-101-4/+23
| | | | error handler for stdin and stdout.
* Fixed sizeof tests for dict and type (they were passed by accident).Serhiy Storchaka2015-12-201-11/+22
| | | | Added tests for dict views iterators.
* Don't create non-needed file.Serhiy Storchaka2015-12-201-5/+0
|
* Use correct PyGC_Head size in tests for issue #25421.Serhiy Storchaka2015-12-191-1/+1
|
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-0/+30
| | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* sys.setrecursionlimit() now raises RecursionErrorVictor Stinner2015-10-121-7/+45
| | | | | | | Issue #25274: sys.setrecursionlimit() now raises a RecursionError if the new recursion limit is too low depending at the current recursion depth. Modify also the "lower-water mark" formula to make it monotonic. This mark is used to decide when the overflowed flag of the thread state is reset.
* (Merge 3.4) Issue #25274: test_recursionlimit_recovery() of test_sys now checksVictor Stinner2015-10-011-2/+3
|\ | | | | | | | | | | sys.gettrace() when the test is executed, not when the module is loaded. sys.settrace() may be after after the test is loaded.
| * Issue #25274: test_recursionlimit_recovery() of test_sys now checksVictor Stinner2015-10-011-2/+3
| | | | | | | | | | | | sys.gettrace() when the test is executed, not when the module is loaded. sys.settrace() may be after after the test is loaded.
* | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-031-3/+3
| |
* | PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-2/+2
| |
* | Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-2/+2
| | | | | | | | Patch by Christie Wilson.
* | Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-2/+3
|\ \ | |/ | | | | objects.
| * Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵Antoine Pitrou2015-03-101-2/+3
| | | | | | | | objects.
* | merge 3.4Benjamin Peterson2015-02-021-1/+1
|\ \ | |/
| * adjust for py3k module renamingBenjamin Peterson2015-02-021-1/+1
| |
* | merge 3.4Benjamin Peterson2015-02-021-0/+1
|\ \ | |/
| * _clear_type_cache is cpython-onlyBenjamin Peterson2015-02-021-0/+1
| |
* | Closes #22668: Merge from 3.4.Stefan Krah2015-01-291-1/+1
|\ \ | |/
* | Issue #23119: Simplify setobject by inlining the special case for unicode ↵Raymond Hettinger2015-01-261-1/+1
| | | | | | | | equality testing.
* | Issue 23261: Clean-up the hack to store the set.pop() search finger in a ↵Raymond Hettinger2015-01-181-1/+1
| | | | | | | | hash field instead of the setobject.
* | Issue #22696: Add function :func:`sys.is_finalizing` to know about ↵Antoine Pitrou2014-12-071-0/+21
| | | | | | | | interpreter shutdown.
* | Issue #22193: Fixed integer overflow error in sys.getsizeof().Serhiy Storchaka2014-11-151-0/+31
|\ \ | |/ | | | | Fixed an error in _PySys_GetSizeOf declaration.
| * Issue #22193: Fixed integer overflow error in sys.getsizeof().Serhiy Storchaka2014-11-151-0/+31
| | | | | | | | Fixed an error in _PySys_GetSizeOf declaration.
* | (Merge 3.4) Closes #22205: sys._debugmallocstats is a cpython specific feature,Victor Stinner2014-08-161-0/+1
|\ \ | |/ | | | | | | so test_debugmallocstats should be marked as such. Patch written by Martin Matusiak.
| * Closes #22205: sys._debugmallocstats is a cpython specific feature, soVictor Stinner2014-08-161-0/+1
| | | | | | | | | | test_debugmallocstats should be marked as such. Patch written by Martin Matusiak.