Skip to content

Commit 4d1f053

Browse files
authored
Merge branch '3.10' into CVE-2020-10735-3.10backport
2 parents 059f402 + bbcb03e commit 4d1f053

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+930
-606
lines changed

.azure-pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1n
60+
openssl_version: 1.1.1q
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1n
86+
openssl_version: 1.1.1q
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1n
60+
openssl_version: 1.1.1q
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1n
86+
openssl_version: 1.1.1q
8787

8888
steps:
8989
- template: ./posix-steps.yml

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
needs: check_source
191191
if: needs.check_source.outputs.run_tests == 'true'
192192
env:
193-
OPENSSL_VER: 1.1.1n
193+
OPENSSL_VER: 1.1.1q
194194
PYTHONSTRICTEXTENSIONBUILD: 1
195195
steps:
196196
- uses: actions/checkout@v3
@@ -234,7 +234,7 @@ jobs:
234234
strategy:
235235
fail-fast: false
236236
matrix:
237-
openssl_ver: [1.1.1n, 3.0.2]
237+
openssl_ver: [1.1.1q, 3.0.5]
238238
env:
239239
OPENSSL_VER: ${{ matrix.openssl_ver }}
240240
MULTISSL_DIR: ${{ github.workspace }}/multissl

Doc/c-api/typeobj.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,9 +1990,6 @@ and :c:type:`PyType_Type` effectively act as defaults.)
19901990
PyErr_Restore(error_type, error_value, error_traceback);
19911991
}
19921992

1993-
For this field to be taken into account (even through inheritance),
1994-
you must also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit.
1995-
19961993
Also, note that, in a garbage collected Python,
19971994
:c:member:`~PyTypeObject.tp_dealloc` may be called from
19981995
any Python thread, not just the thread which created the object (if the object
@@ -2010,6 +2007,12 @@ and :c:type:`PyType_Type` effectively act as defaults.)
20102007

20112008
.. versionadded:: 3.4
20122009

2010+
.. versionchanged:: 3.8
2011+
2012+
Before version 3.8 it was necessary to set the
2013+
:const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be
2014+
used. This is no longer required.
2015+
20132016
.. seealso:: "Safe object finalization" (:pep:`442`)
20142017

20152018

@@ -2047,9 +2050,9 @@ This results in types that are limited relative to types defined in Python:
20472050
:ref:`sub-interpreters <sub-interpreter-support>`, so they should not
20482051
include any subinterpreter-specific state.
20492052

2050-
Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI <stable>`,
2051-
any extension modules using static types must be compiled for a specific
2052-
Python minor version.
2053+
Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API
2054+
<stable>` as an opaque struct, any extension modules using static types must be
2055+
compiled for a specific Python minor version.
20532056

20542057

20552058
.. _heap-types:

Doc/howto/logging-cookbook.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,88 @@ You can of course use the conventional means of decoration::
26782678
...
26792679

26802680

2681+
.. _buffered-smtp:
2682+
2683+
Sending logging messages to email, with buffering
2684+
-------------------------------------------------
2685+
2686+
To illustrate how you can send log messages via email, so that a set number of
2687+
messages are sent per email, you can subclass
2688+
:class:`~logging.handlers.BufferingHandler`. In the following example, which you can
2689+
adapt to suit your specific needs, a simple test harness is provided which allows you
2690+
to run the script with command line arguments specifying what you typically need to
2691+
send things via SMTP. (Run the downloaded script with the ``-h`` argument to see the
2692+
required and optional arguments.)
2693+
2694+
.. code-block:: python
2695+
2696+
import logging
2697+
import logging.handlers
2698+
import smtplib
2699+
2700+
class BufferingSMTPHandler(logging.handlers.BufferingHandler):
2701+
def __init__(self, mailhost, port, username, password, fromaddr, toaddrs,
2702+
subject, capacity):
2703+
logging.handlers.BufferingHandler.__init__(self, capacity)
2704+
self.mailhost = mailhost
2705+
self.mailport = port
2706+
self.username = username
2707+
self.password = password
2708+
self.fromaddr = fromaddr
2709+
if isinstance(toaddrs, str):
2710+
toaddrs = [toaddrs]
2711+
self.toaddrs = toaddrs
2712+
self.subject = subject
2713+
self.setFormatter(logging.Formatter("%(asctime)s %(levelname)-5s %(message)s"))
2714+
2715+
def flush(self):
2716+
if len(self.buffer) > 0:
2717+
try:
2718+
smtp = smtplib.SMTP(self.mailhost, self.mailport)
2719+
smtp.starttls()
2720+
smtp.login(self.username, self.password)
2721+
msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (self.fromaddr, ','.join(self.toaddrs), self.subject)
2722+
for record in self.buffer:
2723+
s = self.format(record)
2724+
msg = msg + s + "\r\n"
2725+
smtp.sendmail(self.fromaddr, self.toaddrs, msg)
2726+
smtp.quit()
2727+
except Exception:
2728+
if logging.raiseExceptions:
2729+
raise
2730+
self.buffer = []
2731+
2732+
if __name__ == '__main__':
2733+
import argparse
2734+
2735+
ap = argparse.ArgumentParser()
2736+
aa = ap.add_argument
2737+
aa('host', metavar='HOST', help='SMTP server')
2738+
aa('--port', '-p', type=int, default=587, help='SMTP port')
2739+
aa('user', metavar='USER', help='SMTP username')
2740+
aa('password', metavar='PASSWORD', help='SMTP password')
2741+
aa('to', metavar='TO', help='Addressee for emails')
2742+
aa('sender', metavar='SENDER', help='Sender email address')
2743+
aa('--subject', '-s',
2744+
default='Test Logging email from Python logging module (buffering)',
2745+
help='Subject of email')
2746+
options = ap.parse_args()
2747+
logger = logging.getLogger()
2748+
logger.setLevel(logging.DEBUG)
2749+
h = BufferingSMTPHandler(options.host, options.port, options.user,
2750+
options.password, options.sender,
2751+
options.to, options.subject, 10)
2752+
logger.addHandler(h)
2753+
for i in range(102):
2754+
logger.info("Info index = %d", i)
2755+
h.flush()
2756+
h.close()
2757+
2758+
If you run this script and your SMTP server is correctly set up, you should find that
2759+
it sends eleven emails to the addressee you specify. The first ten emails will each
2760+
have ten log messages, and the eleventh will have two messages. That makes up 102
2761+
messages as specified in the script.
2762+
26812763
.. _utc-formatting:
26822764

26832765
Formatting times using UTC (GMT) via configuration

Doc/includes/sqlite3/adapter_point_1.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

Doc/includes/sqlite3/adapter_point_2.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

Doc/includes/sqlite3/collation_reverse.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

Doc/includes/sqlite3/converter_point.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

Doc/includes/sqlite3/ctx_manager.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

Doc/includes/sqlite3/execute_1.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

Doc/includes/sqlite3/load_extension.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

Doc/includes/sqlite3/md5func.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

Doc/includes/sqlite3/mysumaggr.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)