Commit Graph

109400 Commits

Author SHA1 Message Date
Inada Naoki 58cffba187
bpo-43651: Fix EncodingWarning in test_io (GH-25097) 2021-04-01 11:25:04 +09:00
Inada Naoki 55f31be44b
bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-25109) 2021-04-01 11:23:03 +09:00
Victor Stinner ad493edf57
bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122) 2021-04-01 02:28:23 +02:00
Ethan Furman 49aec1a185
Enum: add (re)import of Flag for doctests (GH-25118)
Fix issue with CI doctest forgetting that ``Flag`` had already been imported.
2021-03-31 09:20:08 -07:00
Julien Palard 202b546442
Disambiguate that -m also terminates the option list in the manpage. (GH-25100) 2021-03-31 14:31:38 +02:00
Victor Stinner f3ab670fea
bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (#25110)
Skip the test if setlocale() fails.
2021-03-31 13:01:46 +02:00
Łukasz Langa 027d2cf1e5
Document GH-24624 2021-03-31 12:22:37 +02:00
Jessica Clarke dec0757549
bpo-43179: Generalise alignment for optimised string routines (GH-24624)
* Remove m68k-specific hack from ascii_decode

On m68k, alignments of primitives is more relaxed, with 4-byte and
8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
does not work. Instead, use the portable alternative.

Note that this is a minimal fix that only relaxes the assertion and the
condition for when to use the optimised version remains overly strict.
Such issues will be fixed tree-wide in the next commit.

NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
we use autoconf.

* Optimise string routines for architectures with non-natural alignment

C only requires that sizeof(x) is a multiple of alignof(x), not that the
two are equal. Thus anywhere where we optimise based on alignment we
should be using alignof(x) not sizeof(x).

This is more annoying than it would be in C11 where we could just use
_Alignof(x) (and alignof(x) in C++11), but since we still require only
C99 we must plumb the information all the way from autoconf through the
various typedefs and defines.
2021-03-31 12:12:39 +02:00
Inada Naoki cfa176685a
Revert "bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)" (#25108)
This reverts commit ff3c9739bd.
2021-03-31 18:49:41 +09:00
Inada Naoki ff3c9739bd
bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)
It make `encoding="locale"` usable everywhere `encoding=None` is
allowed.
2021-03-31 14:26:08 +09:00
Terry Jan Reedy 1b4a9c7956
bpo-42225: IDLE - document two unix-related problems. (#25078)
1. Bad IP masquerade rules can prevent startup.
2. X cannot handle some complex colored chars.
2021-03-31 01:19:38 -04:00
Ethan Furman b775106d94
bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)
* Enum: streamline repr() and str(); improve docs

- repr() is now ``enum_class.member_name``
- stdlib global enums are ``module_name.member_name``
- str() is now ``member_name``
- add HOW-TO section for ``Enum``
- change main documentation to be an API reference
2021-03-30 21:17:26 -07:00
Alex Prengère 51a85ddce8
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) 2021-03-31 00:11:29 +03:00
Antoine Pitrou 73b20ae2fb
bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962)
Complete the update to libmpdec-2.5.1.

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2021-03-30 18:11:06 +02:00
Brett Cannon a7ff6df60c
bpo-42134: Raise ImportWarning when calling find_module() in the import system (GH-25044) 2021-03-30 08:43:03 -07:00
Grégory Starck cf35e05f89
bpo-43125: Fix: return expected type (str), not original value (bytes) in email/base64mime.py::body_encode (GH-24476) 2021-03-30 17:37:37 +09:00
Zackery Spytz dfeec347f2
bpo-43637: Fix a possible memory leak in winreg.SetValueEx() (GH-25038) 2021-03-30 15:22:34 +09:00
Inada Naoki 068ebf9729
bpo-33164: blake2: Fix Coverity scan (GH-25060) 2021-03-30 12:25:28 +09:00
Neil Schemenauer 85b6b70589
bpo-37448: Use radix tree for pymalloc address_in_range(). (GH-14474)
The radix tree approach is a relatively simple and memory sanitary
alternative to the old (slightly) unsanitary address_in_range().
To disable the radix tree map, set a preprocessor flag as follows:
-DWITH_PYMALLOC_RADIX_TREE=0.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
2021-03-29 19:51:15 -07:00
Christian Heimes a54fc683f2
bpo-43631: Update to OpenSSL 1.1.1k (GH-25024)
- [x] Build OpenSSL 1.1.1k for macOS
- [x] Build OpenSSL 1.1.1k for Windows

I have also updated multissl tester and various CI configurations to use latest OpenSSL. The versions were all over the place.

Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2021-03-29 17:00:34 -07:00
Pablo Galindo 92a02c1f7e
Fix tokenizer error when raw decoding null bytes (GH-25080) 2021-03-30 00:24:49 +01:00
Pablo Galindo 09b90a037d
bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr (GH-25075) 2021-03-29 23:38:51 +01:00
Michael Felt c8b5738810
bpo-43659: Fix test_curses on AIX (GH-25074)
curses.update_lines_cols() is only defined when the curses library
provides either resizeterm() or resize_term() functions which are optional
and are not provided on AIX.
2021-03-29 22:06:24 +03:00
Jesús Cea 32430aadad
bpo-35930: Raising an exception raised in a "future" instance will create reference cycles (#24995)
Before: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0002.png

After: https://lists.es.python.org/pipermail/general/attachments/20201229/0c14bc58/attachment-0003.png
2021-03-29 19:22:13 +02:00
Harry 7bfd65eba7
bpo-43648: Remove redundant datefmt option in logging file config (GH-25051)
[bpo-43648](): Remove redundant datefmt option in logging file config

Automerge-Triggered-By: GH:vsajip
2021-03-29 07:16:19 -07:00
Serhiy Storchaka c1b073a630
bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057) 2021-03-29 22:39:31 +09:00
Pablo Galindo 70cdf1812c
bpo-40645: Fix reference leak in the _hashopenssl extension (GH-25063) 2021-03-29 06:17:40 -07:00
Victor Stinner 9b999479c0
bpo-42988: Remove the pydoc getfile feature (GH-25015)
CVE-2021-3426: Remove the "getfile" feature of the pydoc module which
could be abused to read arbitrary files on the disk (directory
traversal vulnerability). Moreover, even source code of Python
modules can contain sensitive data like passwords. Vulnerability
reported by David Schwörer.
2021-03-29 14:40:40 +02:00
Inada Naoki 4827483f47
bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481)
See [PEP 597](https://www.python.org/dev/peps/pep-0597/).

* Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`.
* Add EncodingWarning
* Add io.text_encoding()
* open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled.
* _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python)
* bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding().
* What's new entry
2021-03-29 12:28:14 +09:00
Pablo Galindo 261a452a13
bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050) 2021-03-28 23:48:05 +01:00
Irit Katriel fb1d01b963
bpo-31907: [doc] clarify that str.format() does not support arbitrary expressions (#25053) 2021-03-28 16:47:20 -04:00
Jason R. Coombs af50c84643
bpo-43644: Add docs for importlib.resources.as_file. (#25048) 2021-03-27 20:25:53 -04:00
Carl Meyer 29c451c698
bpo-43562: fix test_ssl to skip on unreachable network (GH-24937)
This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network.
2021-03-27 14:52:28 -07:00
Irit Katriel a53e9a7cf5
bpo-39231: correct tutorial annotations section (GH-25029) 2021-03-27 13:20:58 -04:00
Christian Heimes bacefbf414
bpo-43466: Unsupported static build hack (GH-25002)
Add undocumented hack to statically link ssl and hashlib modules with
OpenSSL.

Signed-off-by: Christian Heimes <christian@python.org>
2021-03-27 10:03:54 -07:00
Ville Skyttä 9798cef92b
bpo-39616: clarify SSLContext.check_hostname effect (GH-18484)
It doesn't actually affect whether match_hostname() is called (it
never is in this context any longer), but whether hostname
verification occurs in the first place.
2021-03-27 07:20:11 -07:00
Christian Heimes 933dfd7504
bpo-40645: use C implementation of HMAC (GH-24920)
- [x] fix tests
- [ ] add test scenarios for old/new code.

Signed-off-by: Christian Heimes <christian@python.org>
2021-03-27 06:55:03 -07:00
Christian Heimes 5d6e8c1c1a
bpo-43617: Check autoconf-archive package in configure.ac (GH-25016)
Signed-off-by: Christian Heimes <christian@python.org>
2021-03-27 14:44:04 +01:00
Pablo Galindo 11b85abbae
bpo-43636: Validate the version tag in _PyType_Lookup (GH-25032) 2021-03-27 03:51:46 +00:00
Jürgen Gmach 027b669927
bpo-43354: xmlrpc: Fix type documentation for Fault.faultCode (GH-24707)
The type of `faultCode` has to be an `int` instead of a `str`.

cf http://xmlrpc.com/spec.md

Pinging @pganssle
2021-03-26 14:09:09 -07:00
Brett Cannon 1899087b21
bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) 2021-03-26 11:55:07 -07:00
Jared Sutton 21a2cabb37
bpo-43620: Remove reference to os.sep from os.path.join() doc (#25025)
- removed ambiguous reference to os.sep from os.path.join() doc
2021-03-26 12:02:32 -04:00
Raymond Hettinger 3bb19873ab
Revert "bpo-40521: Remove freelist from collections.deque() (GH-21073)" (GH-24944)
This reverts commit 32f2eda859.
It can be re-applied if the subinterpreter PEP is approved.
Otherwise, the commit degraded performance with no offsetting
benefit.
2021-03-25 13:32:23 -07:00
Erlend Egeberg Aasland 929c9039fe
bpo-43416: Add Include/README.rst (GH-24884) 2021-03-25 17:16:31 +01:00
blopblopy 56816bb845
"exists" -> "exist" in What's New 3.10 (GH-25019) 2021-03-25 09:14:22 -07:00
Mark Shannon d41bdddbed
Move big block of macros out of function to improve readability. (GH-25020) 2021-03-25 12:00:30 +00:00
Inada Naoki b045cdaf34
Doc: io: Remove "In-memory streams" section (GH-24927) 2021-03-25 16:23:50 +09:00
Dong-hee Na df9ade9beb
AC: Update unsupported_special_methods (GH-24956) 2021-03-25 09:19:23 +09:00
Raymond Hettinger 72789592a3
bpo-43198: Revert 3dd2157 that removed freeslot tracking. (#25010) 2021-03-24 15:33:27 -07:00
Pablo Galindo 8efad61963
bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006) 2021-03-24 19:34:17 +00:00