Update to 3.11.0rc1

This commit is contained in:
Tomáš Hrnčiar 2022-08-08 15:45:34 +02:00
parent 9518f2915c
commit ab88d7f86c
3 changed files with 7 additions and 90 deletions

View File

@ -1,77 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Fri, 8 Jul 2022 12:19:43 +0200
Subject: [PATCH] 00385: gh-94675: Add a regression test for rjsmin re slowdown
This tests a speed regression in the re module
which prevented chromium from building in Fedora.
https://github.com/python/cpython/pull/94685
---
Lib/test/test_re.py | 31 ++++++++++++++++++-
...2-07-08-12-22-00.gh-issue-94675.IiTs5f.rst | 1 +
2 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 Misc/NEWS.d/next/Tests/2022-07-08-12-22-00.gh-issue-94675.IiTs5f.rst
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index ab980793fa..5d946370ee 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,6 +1,7 @@
from test.support import (gc_collect, bigmemtest, _2G,
cpython_only, captured_stdout,
- check_disallow_instantiation, is_emscripten, is_wasi)
+ check_disallow_instantiation, is_emscripten, is_wasi,
+ SHORT_TIMEOUT)
import locale
import re
import string
@@ -11,6 +12,14 @@
from re import Scanner
from weakref import proxy
+# some platforms lack working multiprocessing
+try:
+ import _multiprocessing
+except ImportError:
+ multiprocessing = None
+else:
+ import multiprocessing
+
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
@@ -2438,6 +2447,26 @@ def test_template_function_and_flag_is_deprecated(self):
self.assertTrue(template_re1.match('ahoy'))
self.assertFalse(template_re1.match('nope'))
+ @unittest.skipIf(multiprocessing is None, 'test requires multiprocessing')
+ def test_regression_gh94675(self):
+ pattern = re.compile(r'(?<=[({}])(((//[^\n]*)?[\n])([\000-\040])*)*'
+ r'((/[^/\[\n]*(([^\n]|(\[\n]*(]*)*\]))'
+ r'[^/\[]*)*/))((((//[^\n]*)?[\n])'
+ r'([\000-\040]|(/\*[^*]*\*+'
+ r'([^/*]\*+)*/))*)+(?=[^\000-\040);\]}]))')
+ input_js = '''a(function() {
+ ///////////////////////////////////////////////////////////////////
+ });'''
+ p = multiprocessing.Process(target=pattern.sub, args=('', input_js))
+ p.start()
+ p.join(SHORT_TIMEOUT)
+ try:
+ self.assertFalse(p.is_alive(), 'pattern.sub() timed out')
+ finally:
+ if p.is_alive():
+ p.terminate()
+ p.join()
+
def get_debug_out(pat):
with captured_stdout() as out:
diff --git a/Misc/NEWS.d/next/Tests/2022-07-08-12-22-00.gh-issue-94675.IiTs5f.rst b/Misc/NEWS.d/next/Tests/2022-07-08-12-22-00.gh-issue-94675.IiTs5f.rst
new file mode 100644
index 0000000000..d0005d9f60
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-07-08-12-22-00.gh-issue-94675.IiTs5f.rst
@@ -0,0 +1 @@
+Add a regression test for :mod:`re` exponentional slowdown when using rjsmin.

View File

@ -14,7 +14,7 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well
%global general_version %{pybasever}.0
%global prerel b5
%global prerel rc1
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
@ -67,7 +67,7 @@ License: Python
# If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below.
# This needs to be manually updated when we update Python.
%global pip_version 22.2
%global pip_version 22.2.2
%global setuptools_version 63.2.0
# Expensive optimizations (mainly, profile-guided optimizations)
@ -322,15 +322,6 @@ Patch328: 00328-pyc-timestamp-invalidation-mode.patch
# https://github.com/GrahamDumpleton/mod_wsgi/issues/730
Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
# 00385 # d7319d51c72f0a6c1af5f32a728de1e3f8fea514
# gh-94675: Add a regression test for rjsmin re slowdown
#
# This tests a speed regression in the re module
# which prevented chromium from building in Fedora.
#
# https://github.com/python/cpython/pull/94685
Patch385: 00385-gh-94675-add-a-regression-test-for-rjsmin-re-slowdown.patch
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
@ -1603,6 +1594,9 @@ CheckPython optimized
# ======================================================
%changelog
* Mon Aug 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~rc1-1
- Update to 3.11.0rc1
* Tue Jul 26 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b5-1
- Update to 3.11.0b5

View File

@ -1,2 +1,2 @@
SHA512 (Python-3.11.0b5.tar.xz) = b1013e449c9a0e9b61df5a266b5f05458d284b3524c6c44d44d8a5007bcb95ff754f21296cd695f353111575c7cce71f8a2808a9adf8c573512bf97f691d2200
SHA512 (Python-3.11.0b5.tar.xz.asc) = 6f658c7623e7750c0c8c18b4a2fe86d6a2414f3b411487ca4d2dd9840165ae3e6eea8b3468b1376862181b7b58d3fe99681a00d290172a6986f0f2ead5d6c3bd
SHA512 (Python-3.11.0rc1.tar.xz) = 2a72ea59277f8115e418ced671969fc0d5ba271c7740f70c665a4b450a59d7752278d061bd59f136dacfa608ed167f983c6589b214a973b1b63ea2115ea298bb
SHA512 (Python-3.11.0rc1.tar.xz.asc) = d4cffc90c2ed7b8ea7228a21f7ac902a92f27003f1420ad751b1691de950974ea174cb0471b6e19ed1548dc5382012fa9ad5fcf83c34646c7ea2d73c88799e38