Commit Graph

113128 Commits

Author SHA1 Message Date
Erlend Egeberg Aasland 95573ade42
gh-69093: sqlite3 blob doc amendments (GH-91561)
- document that you cannot open a blob handle in a WITHOUT ROWID table
- document the blobopen() positional arguments in the same order as they
  appear
- relocate sqlite3.Blob section
2022-04-16 06:28:38 -07:00
Matthew Rahtz f2bc12f0d5
bpo-43224: Add tests for TypeVarTuple substitution in Annotated (GH-31846) 2022-04-15 21:24:28 -07:00
Jack DeVries 468314cc8b
gh-82849: revise intro to os.path.rst (GH-32232)
* revise the first paragraph of docs for os.path
* add a mention of `os.PathLike` protocol
* remove warnings rendered irrelevant by :pep:`383` and :pep:`529`

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-15 21:23:07 -07:00
Erlend Egeberg Aasland a861756675
gh-69093: Add context manager support to sqlite3.Blob (GH-91562) 2022-04-15 21:21:12 -07:00
Alex Waygood 4e661cd691
Issue templates: Remove duplicate links to security policy (#91590)
* Remove security link from config file
* Delete security.md
2022-04-16 04:06:51 +02:00
Alex Waygood 1169b0b3ca
Add minimal issue templates (#91569)
* Add minimal issue templates
* Wording tweaks
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Improve words in `security` template
* Update bug.md
* Update crash.md
* Add link to security vulnerability website from first page
* Never edit on your phone
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update .github/ISSUE_TEMPLATE/config.yml
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* There might not be a traceback if there's a crash
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Update .github/ISSUE_TEMPLATE/config.yml
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Reorder `config.yml` file
* Fix Erlend's nits
* version -> architecture
* Apply suggestions from code review
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-04-16 03:20:54 +02:00
slateny c4e8a93eb3
Add link to documentation translation list (#91560) 2022-04-16 03:18:10 +02:00
msoxzw 42fabc3ea7
gh-91487: Optimize asyncio UDP speed (GH-91488)
Fix #91487

When transferring a small file, e.g. 256 KiB, the speed of this PR is comparable. However, if a large file, e.g. 65536 KiB, is transferred, asyncio UDP will be over 100 times faster than the original. The speed is presumably significantly faster if a larger file is transferred, e.g. 1048576 KiB.

Automerge-Triggered-By: GH:gpshead
2022-04-15 12:59:01 -07:00
Brett Cannon c9e231de85
gh-91217: deprecate nntplib (GH-91543) 2022-04-15 12:32:56 -07:00
Irit Katriel ea2ae02607
gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215) 2022-04-15 20:19:24 +01:00
Irit Katriel 5d421d7342
gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531) 2022-04-15 19:57:47 +01:00
Erlend Egeberg Aasland c06a4ffe81
gh-69093: improve sqlite3.Connection.blobopen() error handling (GH-91571)
Unless sqlite3_blob_open() returns SQLITE_MISUSE, the error code and
message are available on the connection object. This means we have to
handle SQLITE_MISUSE error messages explicitly.
2022-04-15 09:27:39 -07:00
Brandt Bucher 1b34b5687b
gh-91404: Use computed gotos and reduce indirection in re (#91495) 2022-04-15 09:26:44 -07:00
Erlend Egeberg Aasland d104f4d21f
gh-69093: Don't allow instantiation of sqlite3.Blob objects (GH-91570) 2022-04-15 09:25:03 -07:00
Dennis Sweeney 72965981d1
gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH-91476) 2022-04-15 23:21:35 +09:00
Jelle Zijlstra b7f83bdd0e
gh-69093: Expose sqlite3.Blob as a class (GH-91550)
I noticed this was missing while writing typeshed stubs. It's
useful to expose it for use in annotations and for exploration.
2022-04-15 06:29:57 -07:00
Oleg Iarygin 6217864fe5
gh-79156: Add start_tls() method to streams API (#91453)
The existing event loop `start_tls()` method is not sufficient for
connections using the streams API. The existing StreamReader works
because the new transport passes received data to the original protocol.
The StreamWriter must then write data to the new transport, and the
StreamReaderProtocol must be updated to close the new transport
correctly.

The new StreamWriter `start_tls()` updates itself and the reader
protocol to the new SSL transport.

Co-authored-by: Ian Good <icgood@gmail.com>
2022-04-15 14:23:14 +02:00
Jens Holzkämper bd26ef5e9e
bpo-40376: slightly improved the wording for os.getgrouplist (GH-19702)
The documentation for os.getgrouplist potentially read like it
returned all groups a user belongs to but it potentially doesn't.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-14 20:55:07 -07:00
Dong-hee Na 2bf5f64455
Remove usage of _Py_IDENTIFIER from unicodedata module. (GH-91532) 2022-04-15 10:44:05 +09:00
Jelle Zijlstra f1e989b045
gh-70979: Fix runpy.run_path parameter name in docs (GH-32265)
Noticed while reviewing GH-30729.
2022-04-14 18:06:58 -07:00
Barry Warsaw 1fcb39ea64
gh-91520: Rewrite imghdr inlining for clarity and completeness (#91521)
* Rewrite imghdr inlining for clarity and completeness

* Move MIMEImage class back closer to the top of the file since it's the
  important thing.
* Use a decorate to mark a given rule function and simplify the rule function
  names for clarity.
* Copy over all the imghdr test data files into the email package's test data
  directory.  This way when imghdr is actually removed, it won't affect the
  MIMEImage guessing tests.
* Rewrite and extend the MIMEImage tests to test for all supported
  auto-detected MIME image subtypes.
* Remove the now redundant PyBanner048.gif data file.

* See https://github.com/python/cpython/pull/91461#discussion_r850313336

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
2022-04-14 17:48:59 -07:00
Erlend Egeberg Aasland ee475430d4
gh-69093: Support basic incremental I/O to blobs in `sqlite3` (GH-30680)
Authored-by: Aviv Palivoda <palaviv@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
Co-authored-by: palaviv <palaviv@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-14 17:02:56 -07:00
Dennis Sweeney c9d41bcd68
gh-91428: include specialized opcodes in _PyOpcode_OpName (GH-91467) 2022-04-14 16:00:58 -04:00
Brett Cannon 1b6cd872f4
gh-91217: deprecate msilib (GH-91515) 2022-04-14 12:50:11 -07:00
Gregory P. Smith 861974b514
gh-89455: Fix an uninitialized bool in exception print context. (#91466)
Fix an uninitialized bool in exception print context.
    
`struct exception_print_context.need_close` was uninitialized.
    
Found by oss-fuzz in a test case running under the undefined behavior sanitizer.
    
https://oss-fuzz.com/testcase-detail/6217746058182656
    
```
Python/pythonrun.c:1241:28: runtime error: load of value 253, which is not a valid value for type 'bool'
    #0 0xbf2203 in print_chained cpython3/Python/pythonrun.c:1241:28
    #1 0xbea4bb in print_exception_cause_and_context cpython3/Python/pythonrun.c:1320:19
    #2 0xbea4bb in print_exception_recursive cpython3/Python/pythonrun.c:1470:13
    #3 0xbe9e39 in _PyErr_Display cpython3/Python/pythonrun.c:1517:9
```
    
Pretty obvious what the ommission was upon code inspection.
2022-04-14 11:26:25 -07:00
Christian Heimes 7acedd71de
gh-84461: Drop -sWASM, fix building tests for browser (GH-91530)
- drop unnecessary ``=1`` suffix from Emscripten flags
- drop unnecessary ``-sWASM`` flag for side modules
- rename ``build_platform`` to ``build_wasm``. I introduced the target
  for WASM builds a couple of months ago.
- fix ``--enable-test-modules`` for browser builds
2022-04-14 16:27:41 +02:00
Hood Chatham 1b035d9699
gh-91353: Fix void return type handling in ctypes (GH-32246) 2022-04-14 16:27:01 +02:00
Ezio Melotti 17dbb6bc10
Add redirects to Misc/NEWS bpo links (#91454) 2022-04-14 16:06:01 +02:00
slateny 0fc3517cf4
gh-90879: Fix missing parameter for put_nowait() (GH-91514) 2022-04-14 17:23:57 +09:00
Inada Naoki 13b17e2a0a
gh-91156: Fix `encoding="locale"` in UTF-8 mode (GH-70056) 2022-04-14 16:00:35 +09:00
Dong-hee Na 7b87e8af0c
gh-90699: Remove usage of _Py_IDENTIFIER from bisect module. (GH-91522) 2022-04-14 14:57:25 +09:00
slateny 45e8c9d43f
gh-90326: Remove quotes for logging config (GH-91516) 2022-04-14 05:15:00 +01:00
Pieter Eendebak 355cbaadbb
gh-91266: refactor bytearray strip methods (GH-32096) 2022-04-13 22:20:38 -04:00
Alix Lourme 325d6f5035
gh-87497: Document that urllib.request sends headers in camel case (GH-24661)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-13 19:19:16 -07:00
L. A. F. Pereira 5f056acdf2
Fill holes in internal compiler structs (#91458) 2022-04-13 15:09:20 -07:00
Irit Katriel 04f9658c59
gh-90449: Improve accuracy and readability of exceptions tutorial (GH-31899) 2022-04-13 21:45:33 +01:00
Brett Cannon 3fc57e8f6f
gh-91217: deprecate imghdr (#91461)
* Deprecate imghdr

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Update Doc/whatsnew/3.11.rst

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Inline `imghdr` into `email.mime.image`

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
2022-04-13 10:47:41 -07:00
David Foster dfbc792a4b
gh-91243: Update authors for Required[] and NotRequired[] implementation (GH-91506) 2022-04-13 07:52:19 -07:00
Nikita Sobolev 63a032270e
gh-90971: suppress deprecation warning in `test_lib2to3`(GH-31464)
Fixes GH-90971

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
2022-04-13 07:42:25 -07:00
Pablo Galindo Salgado 37a53fb6bd
gh-91502: Add a new API to check if a frame is an entry frame (GH-91503) 2022-04-13 14:06:56 +01:00
Dustin Rodrigues 54f67ad543
bpo-43218: Prevent venv creation when the target directory contains a PATH separator. (GH-24530) 2022-04-13 09:07:10 +01:00
Serhiy Storchaka 15537c51c1
bpo-43224: Forbid TypeVar substitution with Unpack (GH-32031) 2022-04-12 20:08:49 -07:00
Tobias Stoeckmann 0859368335
gh-91421: Use constant value check during runtime (GH-91422)
The left-hand side expression of the if-check can be converted to a
constant by the compiler, but the addition on the right-hand side is
performed during runtime.

Move the addition from the right-hand side to the left-hand side by
turning it into a subtraction there. Since the values are known to
be large enough to not turn negative, this is a safe operation.

Prevents a very unlikely integer overflow on 32 bit systems.

Fixes GH-91421.
2022-04-12 20:01:02 -07:00
Jelle Zijlstra ac6c3de03c
gh-91243: Add typing.Required and NotRequired (PEP 655) (GH-32419)
I talked to @davidfstr and I offered to implement the runtime part of PEP 655
to make sure we can get it in before the feature freeze. We're going to defer
the documentation to a separate PR, because it can wait until after the feature
freeze.

The runtime implementation conveniently already exists in typing-extensions,
so I largely copied that.

Co-authored-by: David Foster <david@dafoster.net>
2022-04-12 12:31:02 -07:00
Serhiy Storchaka 474fdbe9e4
bpo-47152: Automatically regenerate sre_constants.h (GH-91439)
* Move the code for generating Modules/_sre/sre_constants.h from
  Lib/re/_constants.py into a separate script
  Tools/scripts/generate_sre_constants.py.
* Add target `regen-sre` in the makefile.
* Make target `regen-all` depending on `regen-sre`.
2022-04-12 18:34:06 +03:00
Ilya Leoshkevich 943ca5e1d6
gh-90839: Forward gzip.compress() compresslevel to zlib (gh-31215) 2022-04-12 22:46:40 +09:00
Irit Katriel e44f988b26
gh-91276: make space for longer opcodes in dis output (GH-91444) 2022-04-12 14:35:56 +01:00
Jack DeVries f33e2c87a8
gh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434)
* add a paragraph to document this kwarg in detail
* update docstring in the source accordingly
2022-04-11 17:57:52 -07:00
Erlend Egeberg Aasland 9ebcece82f
gh-79097: Add support for aggregate window functions in sqlite3 (GH-20903) 2022-04-11 17:55:59 -07:00
Brett Cannon f45aa8f304
gh-91217: deprecate crypt (GH-91459) 2022-04-11 17:02:19 -07:00