summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-43998: Fix testing without ssl module (GH-25790)Christian Heimes2021-05-011-3/+4
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43957: Add a missins space to the new format enum warning (#25770)Pablo Galindo2021-05-011-1/+1
|
* bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)Christian Heimes2021-05-018-18/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ssl module now has more secure default settings. Ciphers without forward secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits weak RSA, DH, and ECC keys with less than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2. Settings are based on Hynek Schlawack's research. ``` $ openssl version OpenSSL 1.1.1k FIPS 25 Mar 2021 $ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM' TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD TLS_AES_128_CCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESCCM(128) Mac=AEAD ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384 ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384 ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256 ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(128) Mac=AEAD DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256 DHE-RSA-AES128-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256 ``` Signed-off-by: Christian Heimes <christian@python.org>
* Fixing doc for callback for lambda (GG-25779)Shreyash Sharma2021-05-011-1/+1
| | | Fixing callback for lambda when no return value is provided
* If using a frozen class with slots, add __getstate__ and __setstate__ to set ↵Eric V. Smith2021-05-012-2/+34
| | | | the instance values. (GH-25786)
* bpo-43989: Temporarily disable warnings in ssltests (GH-25780)Christian Heimes2021-05-011-1/+1
| | | -Werror is currently broken.
* bpo-43993: Update vendored pip to 21.1.1 (GH-25761)Stéphane Bidoul2021-05-013-1/+2
|
* Noted my recent contributions in "What's New In Python 3.10". (#25771)larryhastings2021-05-011-20/+33
| | | Noted my recent contributions in "What's New In Python 3.10". Also made some edits clarifying "annotations" vs "type hints", and some other edits for correctness.
* bpo-42269: Add slots parameter to dataclass decorator (GH-24171)Yurii Karabas2021-05-015-11/+111
| | | Add slots parameter to dataclass decorator and make_dataclass function.
* bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the ↵Pablo Galindo2021-05-014-3/+5
| | | | curses module (GH-25768)
* bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738)Ma Lin2021-04-303-71/+77
| | | | | | | | | | | | | | | | * Fix initial buffer size can't > UINT32_MAX in zlib module After commit f9bedb630e8a0b7d94e1c7e609b20dfaa2b22231, in 64-bit build, if the initial buffer size > UINT32_MAX, ValueError will be raised. These two functions are affected: 1. zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE) 2. zlib.Decompress.flush([length]) This commit re-allows the size > UINT32_MAX. * adds curly braces per PEP 7. * Renames `Buffer_*` to `OutputBuffer_*` for clarity
* bpo-43995: Fix reference leak in test_grammar (GH-25764)Erlend Egeberg Aasland2021-04-301-4/+5
|
* bpo-43971: Add spaces around annotated arg default '=' (GH-25702)Mohamed Moselhy2021-04-301-1/+1
| | | Result: "quantity_on_hand: int = 0".
* bpo-43928: Fix 'succesfully' typo in document (GH-25569)JT2021-04-301-1/+1
|
* bpo-43935: Fix typo in Turtle.back() docstring (GH-25581)Tarjei Bærland2021-04-301-1/+1
| | | 'e ,' to 'e, '.
* bpo-43888: Remove coverage builds from CI (GH-25679)Ammar Askar2021-04-304-184/+0
| | | The coverage builds were consistently timing out in CI, suggesting that people were not reviewing the uploaded reports.
* 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.