summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-43979: Remove unnecessary operation from urllib.parse.parse_qsl (GH-25756)Dong-hee Na2021-04-302-2/+3
| | | Automerge-Triggered-By: GH:gpshead
* bpo-43981: Fix reference leaks in test_squeezer (GH-25758)Pablo Galindo2021-04-302-0/+2
|
* bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753)Victor Stinner2021-04-305-8/+39
| | | | | | | | | | The following types use Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * _md5.md5 * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512
* bpo-43901: Fix refleaks in test_module (GH-25754)Pablo Galindo2021-04-302-5/+13
|
* bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751)Victor Stinner2021-04-302-9/+5
|
* bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)Erlend Egeberg Aasland2021-04-3020-28/+87
| | | | | | | | | | | | | | | | | | | | | Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types: * _dbm.dbm * _gdbm.gdbm * _multibytecodec.MultibyteCodec * _sre..SRE_Scanner * _thread._localdummy * _thread.lock * _winapi.Overlapped * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * pyexpat.xmlparser * re.Match * re.Pattern * unicodedata.UCD * zlib.Compress * zlib.Decompress
* bpo-43916: select.poll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25750)Erlend Egeberg Aasland2021-04-302-13/+8
|
* bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)Mark Shannon2021-04-307-2952/+2961
| | | * Set line number of __exit__ call in a with statement to be that of the with keyword.
* bpo-43908: check_set_special_type_attr() checks Py_TPFLAGS_IMMUTABLETYPE ↵Erlend Egeberg Aasland2021-04-302-9/+15
| | | | | | | | (GH-25743) check_set_special_type_attr() and type_set_annotations() now check for immutable flag (Py_TPFLAGS_IMMUTABLETYPE). Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096)Jakub Kulík2021-04-306-0/+194
|
* bpo-43916: PyStdPrinter_Type uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25749)Victor Stinner2021-04-303-28/+61
| | | | | | | The PyStdPrinter_Type type now uses the Py_TPFLAGS_DISALLOW_INSTANTIATION flag to disallow instantiation, rather than seting a tp_init method which always fail. Write also unit tests for PyStdPrinter_Type.
* bpo-43916: Remove _disabled_new() function (GH-25745)Victor Stinner2021-04-304-30/+9
| | | | | posix and _hashlib use the new Py_TPFLAGS_DISALLOW_INSTANTIATION flag on their heap types, rather than using a custom tp_new function (_disabled_new).
* bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)Victor Stinner2021-04-3013-102/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow creating type instances: set tp_new to NULL and don't create the "__new__" key in the type dictionary. The flag is set automatically on static types if tp_base is NULL or &PyBaseObject_Type and tp_new is NULL. Use the flag on the following types: * _curses.ncurses_version type * _curses_panel.panel * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _xxsubinterpretersmodule.ChannelID * sys.flags type * sys.getwindowsversion() type * sys.version_info type Update MyStr example in the C API documentation to use Py_TPFLAGS_DISALLOW_INSTANTIATION. Add _PyStructSequence_InitType() function to create a structseq type with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set. type_new() calls _PyType_CheckConsistency() at exit.
* bpo-43973: object_set_class() checks Py_TPFLAGS_IMMUTABLETYPE (GH-25714)Erlend Egeberg Aasland2021-04-301-3/+3
| | | Use Py_TPFLAGS_IMMUTABLETYPE to check for class assignments.
* bpo-43977: Use tp_flags for collection matching (GH-25723)Mark Shannon2021-04-3016-83/+74
| | | | | | | | | | | | | * Add Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING, add to all relevant standard builtin classes. * Set relevant flags on collections.abc.Sequence and Mapping. * Use flags in MATCH_SEQUENCE and MATCH_MAPPING opcodes. * Inherit Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING. * Add NEWS * Remove interpreter-state map_abc and seq_abc fields.
* bpo-43954: Fix a missing word in the unittest docs (GH-25672)Zackery Spytz2021-04-301-2/+3
|
* bpo-43817: Add inspect.get_annotations(). (#25522)larryhastings2021-04-307-31/+513
| | | | | Add inspect.get_annotations, which safely computes the annotations defined on an object. It works around the quirks of accessing the annotations from various types of objects, and makes very few assumptions about the object passed in. inspect.get_annotations can also correctly un-stringize stringized annotations. inspect.signature, inspect.from_callable, and inspect.from_function now call inspect.get_annotations to retrieve annotations. This means inspect.signature and inspect.from_callable can now un-stringize stringized annotations, too.
* bpo-43981: Fix error in idle-test leak test (GH-25739)Terry Jan Reedy2021-04-301-3/+2
| | | | | Remove call to macosx.setupApp, which calls macosc.overrideRootMenu, which modifies the menus, which results in two failures in the second round of the leak test.
* Two minor fixes for accessing a module's name. (#25658)larryhastings2021-04-302-7/+3
| | | | | | | | | | | | | | | | | While working on another issue, I noticed two minor nits in the C implementation of the module object. Both are related to getting a module's name. First, the C function module_dir() (module.__dir__) starts by ensuring the module dict is valid. If the module dict is invalid, it wants to format an exception using the name of the module, which it gets from PyModule_GetName(). However, PyModule_GetName() gets the name of the module from the dict. So getting the name in this circumstance will never succeed. When module_dir() wants to format the error but can't get the name, it knows that PyModule_GetName() must have already raised an exception. So it leaves that exception alone and returns an error. The end result is that the exception raised here is kind of useless and misleading: dir(module) on a module with no __dict__ raises SystemError("nameless module"). I changed the code to actually raise the exception it wanted to raise, just without a real module name: TypeError("<module>.__dict__ is not a dictionary"). This seems more useful, and would do a better job putting the programmer who encountered this on the right track of figuring out what was going on. Second, the C API function PyModule_GetNameObject() checks to see if the module has a dict. If m->md_dict is not NULL, it calls _PyDict_GetItemIdWithError(). However, it's possible for m->md_dict to be None. And if you call _PyDict_GetItemIdWithError(Py_None, ...) it will *crash*. Unfortunately, this crash was due to my own bug in the other branch. Fixing my code made the crash go away. I assert that this is still possible at the API level. The fix is easy: add a PyDict_Check() to PyModule_GetNameObject(). Unfortunately, I don't know how to add a unit test for this. Having changed module_dir() above, I can't find any other interfaces callable from Python that eventually call PyModule_GetNameObject(). So I don't know how to trick the runtime into reproducing this error. Since both these changes are minor--each entails only a small edit to only one line--I didn't bother with a news item.
* bpo-43901: Lazy-create an empty annotations dict in all unannotated user ↵larryhastings2021-04-309-8/+308
| | | | | classes and modules (#25623) Change class and module objects to lazy-create empty annotations dicts on demand. The annotations dicts are stored in the object's `__dict__` for backwards compatibility.
* bpo-43892: Validate the first term of complex literal value patterns (GH-25735)Brandt Bucher2021-04-308-441/+595
|
* bpo-42800: Rename AUDIT_READ to PY_AUDIT_READ (GH-25736)Steve Dower2021-04-306-14/+14
|
* bpo-42800: add audit hooks for f_code and tb_frame (GH-24182)Ryan Hileman2021-04-2911-15/+32
| | | | | | | | | | Accessing the following attributes will now fire PEP 578 style audit hooks as ("object.__getattr__", obj, name): * PyTracebackObject: tb_frame * PyFrameObject: f_code * PyGenObject: gi_code, gi_frame * PyCoroObject: cr_code, cr_frame * PyAsyncGenObject: ag_code, ag_frame Add an AUDIT_READ attribute flag aliased to READ_RESTRICTED. Update obsolete flag documentation.
* bpo-43933: Show frame.f_lineno as None, rather than -1, if there is no line ↵Mark Shannon2021-04-293-2/+20
| | | | number. (GH-25717)
* bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872)sblondon2021-04-292-3/+3
| | | | | Links for 'raise Exception from x' target to 'The raise statement' (7.8) section instead of 'The import statement' (7.11) section. There are more modified links than in the bug report because I searched some other ones which can get the same improvement.
* bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and ↵Senthil Kumaran2021-04-294-0/+54
| | | | | | | | tabs. (GH-25595) * issue43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-28254: Add PyGC_ functions to the stable ABI manifest (GH-25720)Petr Viktorin2021-04-292-1/+13
| | | | Co-authored-by: Senthil Kumaran <senthil@uthcode.com> Co-authored-by: scoder <stefan_ml@behnel.de>
* bpo-42739: Don't use sentinels to mark end of line table. (GH-25657)Mark Shannon2021-04-2913-4984/+4966
| | | | | * Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust. * Update PyCodeAddressRange to match PEP 626.
* bpo-43651: Fix test_logging (GH-25715)Inada Naoki2021-04-291-2/+1
|
* bpo-43774: Enhance debug build documentation (GH-25712)Victor Stinner2021-04-294-69/+53
| | | | | * Add also references to --with-trace-refs option. * Move _ob_next and _ob_prev at the end, since they don't exist by default and are related to debug.
* bpo-37892: Use space indents in IDLE Shell (GH-25678)Terry Jan Reedy2021-04-293-3/+11
| | | | | | Adding a newline to the prompt moves it out of the way of user code input, which now starts at the left margin, along with continuation lines.
* bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315)Petr Viktorin2021-04-297-139/+2844
|
* bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)Victor Stinner2021-04-298-143/+135
| | | Enhance also the documentation of debug hooks on memory allocators.
* bpo-28254: Cleanup test_subprocess.test_preexec_gc_module_failure() (GH-25709)Victor Stinner2021-04-291-4/+0
| | | Saving/restoring gc.disable and gc.isenabled is no longer needed.
* bpo-43908: Document Static Types in the C API (GH-25710)Victor Stinner2021-04-297-50/+75
| | | Update also PyTypeObject structure definition in the doc.
* bpo-43908: Make array.array type immutable (GH-25696)Erlend Egeberg Aasland2021-04-293-1/+10
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43908: Make re types immutable (GH-25697)Erlend Egeberg Aasland2021-04-293-3/+17
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43892: Make match patterns explicit in the AST (GH-25585)Nick Coghlan2021-04-2920-1348/+3431
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-41139: Deprecate `cgi.log()` (GH-25625)Inada Naoki2021-04-294-1/+10
|
* bpo-43651: Fix EncodingWarning in `os.fdopen()` and test_os (GH-25654)Inada Naoki2021-04-292-13/+16
|
* bpo-43651: Fix EncodingWarning in tests. (GH-25655)Inada Naoki2021-04-293-17/+21
| | | | | * test_httplib * test_httpservers * test_logging
* bpo-24275: Don't downgrade unicode-only dicts to mixed on lookups (GH-25186)Hristo Venev2021-04-292-3/+106
|
* [doc] Be more clear on super() regarding multiple base classes methods ↵Andre Delfino2021-04-291-1/+1
| | | | (GH-21789)
* [doc] Do some polishing in IDEs section (GH-22070)Andre Delfino2021-04-291-12/+12
|
* Document importlib.metadata.PackagePath.locate method (GH-25669)Paul Moore2021-04-281-1/+7
|
* bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class ↵kfollstad2021-04-281-1/+1
| | | | unnecessarily (GH-25699)
* bpo-37903: IDLE: Shell sidebar with prompts (GH-22682)Tal Einat2021-04-2814-131/+887
| | | | | | The first followup will change shell indents to spaces. More are expected. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable (GH-25693)Victor Stinner2021-04-282-123/+5
|
* bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)Erlend Egeberg Aasland2021-04-284-1/+24
| | | | | | Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and modify PyType_Ready() to set it for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-28254: Add a C-API for controlling the GC state (GH-25687)scoder2021-04-287-7/+152
| | | | | | | | Add new C-API functions to control the state of the garbage collector: PyGC_Enable(), PyGC_Disable(), PyGC_IsEnabled(), corresponding to the functions in the gc module. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>