Commit Graph

45980 Commits

Author SHA1 Message Date
Serhiy Storchaka aad8f0eeca
bpo-41112: Fix test_peg_generator on non-UTF-8 locales. (GH-21138) 2020-06-25 14:31:30 +03:00
Serhiy Storchaka 94eee69e9b
bpo-35773: Fix test_bdb on non-UTF-8 locales. (GH-21136) 2020-06-25 14:21:25 +03:00
Hai Shi f7ba40b505
bpo-40275: Use new test.support helper submodules in tests (GH-20849) 2020-06-25 12:38:51 +02:00
Serhiy Storchaka 55939b1708
bpo-41074: Fix support of non-ASCII names and SQL in msilib. (GH-21126)
* Fix support of non-ASCII names in functions OpenDatabase()
  and init_database().
* Fix support of non-ASCII SQL in method Database.OpenView().
2020-06-25 11:37:12 +03:00
Bruce Merry 152f0b8bee
bpo-41002: Optimize HTTPResponse.read with a given amount (GH-20943)
I've done the implementation for both non-chunked and chunked reads. I haven't benchmarked chunked reads because I don't currently have a convenient way to generate a high-bandwidth chunked stream, but I don't see any reason that it shouldn't enjoy the same benefits that the non-chunked case does. I've used the benchmark attached to the bpo bug to verify that performance now matches the unsized read case.

Automerge-Triggered-By: @methane
2020-06-24 23:30:21 -07:00
Serhiy Storchaka a7dc714701
bpo-41094: Additional fix for PYTHONSTARTUP. (GH-21119) 2020-06-24 19:46:30 +03:00
Jürgen Gmach 80526f6841
Fix typo in dataclasses module (GH-21109)
Automerge-Triggered-By: @matrixise
2020-06-24 03:46:52 -07:00
Serhiy Storchaka 6c6810d989
bpo-41094: Fix decoding errors with audit when open files. (GH-21095) 2020-06-24 08:46:05 +03:00
Raymond Hettinger f9bd05e83e
bpo-40521: Empty frozenset is no longer a singleton (GH-21085)
* Revert "bpo-40521: Make the empty frozenset per interpreter (GH-21068)"

This reverts commit 261cfedf76.

* bpo-40521: Empty frozensets are no longer singletons

* Complete the removal of the frozenset singleton
2020-06-23 17:42:55 +02:00
Ram Rachum bc43f6e212
bpo-41065: Use zip-strict in zoneinfo (GH-21031) 2020-06-23 10:21:26 -04:00
Raymond Hettinger 26a1ad1c24
Small clean-ups for the random module (GH-21038) 2020-06-22 19:38:59 -07:00
Krishna Chivukula 9e27bc0c1e
bpo-41005: Fixed perrmission error (GH-20936)
* fixed issue 41005: webbrowser fails when xdg-settings cannot be executed

Co-authored-by: KrishnaSai2020 <krishnasai.chivukula@gmal.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-06-22 11:06:07 +02:00
Serhiy Storchaka 36ff513f82
bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040) 2020-06-22 11:24:11 +03:00
Serhiy Storchaka c88239f864
bpo-26407: Do not mask errors in csv. (GH-20536)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
2020-06-22 11:21:59 +03:00
Serhiy Storchaka cafe1b6e9d
bpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().
2020-06-22 10:43:35 +03:00
Joannah Nanjekye 6f79838fc1
Skip tests to fix bot (GH-20777)
Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
2020-06-21 20:59:43 -03:00
Dong-hee Na 6989af0bc7
bpo-41052: Opt out serialization/deserialization for _random.Random (GH-21002) 2020-06-21 18:44:58 +09:00
Serhiy Storchaka f9bab74d5b
bpo-41055: Remove outdated tests for the tp_print slot. (GH-21006) 2020-06-21 11:11:17 +03:00
Serhiy Storchaka 19fcffa927
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010) 2020-06-21 11:07:50 +03:00
Lysandros Nikolaou 6c4e0bd974
bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020)
`GET_INVALID_TARGET` might unexpectedly return `NULL`, which if not
caught will cause a SEGFAULT. Therefore, this commit introduces a new
inline function `RAISE_SYNTAX_ERROR_INVALID_TARGET` that always
checks for `GET_INVALID_TARGET` returning NULL and can be used in
the grammar, replacing the long C ternary operation used till now.
2020-06-21 03:18:01 +01:00
Lysandros Nikolaou 314858e276
bpo-40939: Remove the old parser (Part 2) (GH-21005)
Remove some remaining files and Makefile targets for the old parser
2020-06-20 19:07:25 +01:00
Batuhan Taskaya 55460ee6dc
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-20 18:40:06 +01:00
Serhiy Storchaka 9355868458
bpo-41043: Escape literal part of the path for glob(). (GH-20994) 2020-06-20 11:10:31 +03:00
Serhiy Storchaka a041e116db
bpo-41040: Fix test_modulefinder. (GH-20991) 2020-06-20 00:06:07 +03:00
Victor Stinner 3358da4054
bpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)
skip_if_broken_multiprocessing_synchronize() only attempts for create
a semaphore on Linux to fix multiprocessing
test_resource_tracker_reused() on macOS.
2020-06-19 18:01:20 +02:00
Christian Heimes 8a0fe7b454
Improve blake2 comment for Victor (GH-20981)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-06-19 07:11:02 -07:00
Jürgen Gmach 66a65ba43c
Improve readability of `formataddr` docstring (GH-20963)
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
2020-06-19 04:57:30 -07:00
Guido van Rossum 310f6aa7db
bpo-40636: PEP 618: add strict parameter to zip() (GH-20921)
zip() now supports PEP 618's strict parameter, which raises a
ValueError if the arguments are exhausted at different lengths.
Patch by Brandt Bucher.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Ram Rachum <ram@rachum.com>
2020-06-19 12:16:57 +02:00
Lysandros Nikolaou 01ece63d42
bpo-40334: Produce better error messages on invalid targets (GH-20106)
The following error messages get produced:
- `cannot delete ...` for invalid `del` targets
- `... is an illegal 'for' target` for invalid targets in for
  statements
- `... is an illegal 'with' target` for invalid targets in
  with statements

Additionally, a few `cut`s were added in various places before the
invocation of the `invalid_*` rule, in order to speed things
up.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-19 00:10:43 +01:00
Serhiy Storchaka 8a64ceaf98
bpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075) 2020-06-18 22:08:27 +03:00
Bar Harel 8f192d12af
bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)
Docs and tests are underway.

Automerge-Triggered-By: @vsajip
2020-06-18 07:18:58 -07:00
Victor Stinner ddbeb2f3e0
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)
On Linux, skip tests using multiprocessing if the current user cannot
create a file in /dev/shm/ directory. Add the
skip_if_broken_multiprocessing_synchronize() function to the
test.support module.
2020-06-18 14:53:19 +02:00
Victor Stinner 9e09849d20
bpo-41006: importlib.util no longer imports typing (GH-20938)
Create importlib._abc submodule to avoid importing typing when
importlib.util is imported. Move Loader ABC into importlib._abc.
2020-06-17 23:15:59 +02:00
stratakis 236a0f5cf0
bpo-40637: Do not emit warnings for disabled builtin hashes (GH-20937)
test_hashlib emits some warnings when it cannot find some hashes
as it assumes they failed to compile. Since we can disable hashes
through configure, we emit the warnings only in the case that we
did not intentionaly disable them.

Automerge-Triggered-By: @tiran
2020-06-17 10:26:08 -07:00
Victor Stinner 98ce7b107e
bpo-41006: pkgutil imports lazily re (GH-20939)
The pkgutil module now imports lazily the re module to speedup Python
startup time.
2020-06-17 19:11:50 +02:00
Victor Stinner 7824cc05bf
bpo-41006: collections imports lazily heap (GH-20940)
The collections module now imports lazily the heapq modules in the
Counter.most_common() method to speedup Python startup time.
2020-06-17 19:10:47 +02:00
Christian Heimes bb6ec14479
bpo-41009: fix requires_OS_version() class decorator (GH-20942)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-06-17 10:09:10 -07:00
Victor Stinner 8362893e3f
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935)
Fix test_copyreg when numpy is installed: test.pickletester now
saves/restores warnings.filters when importing numpy, to ignore
filters installed by numpy.

Add the save_restore_warnings_filters() function to the
test.support.warnings_helper module.
2020-06-17 18:07:13 +02:00
Eric Snow 818f5b597a
bpo-32604: Clean up test.support.interpreters. (gh-20926)
There were some minor adjustments needed and a few tests were missing.

https://bugs.python.org/issue32604
2020-06-16 18:24:40 -06:00
Lysandros Nikolaou 113e2b0a07
bpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888)
When a file ends with a line that contains a line continuation character
the text of the emitted SyntaxError is empty, contrary to the old
parser, where the error text contained the text of the last line.
2020-06-16 01:27:33 +01:00
David Szotten 8666356280
closes bpo-28557: error message for bad raw readinto (GH-7496)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-06-15 18:53:57 -05:00
Xavier Fernandez 5f79f46612
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491) 2020-06-15 15:16:48 -04:00
Krzysztof Konopko 4a3a682b12
bpo-40448: ensurepip: Do not use cache (GH-19812)
ensurepip optionally installs or upgrades 'pip' and 'setuptools' using
the version of those modules bundled with Python.  The internal PIP
installation routine by default temporarily uses its cache, if it
exists.  This is undesirable as Python builds and installations may be
independent of the user running the build, whilst PIP cache location
is dependent on the user's environment and outside of the build
environment.

At the same time, there's no value in using the cache while installing
bundled modules.

This change disables PIP caching when used in ensurepip.
2020-06-15 13:28:46 -04:00
roger d8cf3514dd
bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
2020-06-15 07:58:54 -07:00
Rémi Lapeyre 25f38d7044
bpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() (GH-20563)
Automerge-Triggered-By: @vsajip
2020-06-15 01:03:07 -07:00
Pablo Galindo 78319e373d
Include soft keywords in keyword.py (GH-20877) 2020-06-15 03:55:15 +01:00
Fantix King 8f04a84755
bpo-30064: Fix slow asyncio sock test (GH-20868)
Using a log2n way to fill a much smaller buffer, and receiving in a cleaner way with EOF.

The failing test was reproducible using the following command thanks to @aeros :

```bash
./python -m test test_asyncio.test_sock_lowlevel --match test_sock_client_racing -j100 -F -v
```

According to test results, we may still need to bump the timeout:

5aad027db9/Lib/test/test_asyncio/test_sock_lowlevel.py (L256-L257)
2020-06-14 00:43:57 -07:00
Raymond Hettinger 5aad027db9
Some reformatting (suggested by Black) and minor factoring. (GH-20865) 2020-06-13 19:17:28 -07:00
Raymond Hettinger d71ab4f738
bpo-40855: Fix ignored mu and xbar parameters (GH-20835) 2020-06-13 15:55:52 -07:00
Raymond Hettinger 9db5b8d448
Minor code clean-ups (GH-20838) 2020-06-13 09:46:47 -07:00