From 88bcc0558c76d5fdec6bea01a249bfcde5344c68 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Wed, 22 Nov 2023 17:40:07 +0800 Subject: [PATCH] Fix #930: DeprecationWarning: Flags not at the start of the expression Signed-off-by: zhang-liang-pengkun --- ...ionWarning-Flags-not-at-the-start-of.patch | 39 +++++++++++++++++++ python-bottle.spec | 6 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch diff --git a/0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch b/0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch new file mode 100644 index 0000000..571898d --- /dev/null +++ b/0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch @@ -0,0 +1,39 @@ +From 0c3db605e927e6a58cefaecae3a3c6ef1e34dad5 Mon Sep 17 00:00:00 2001 +From: Marcel Hellkamp +Date: Sat, 1 Dec 2018 17:35:14 +0100 +Subject: [PATCH] Fix #930: DeprecationWarning: Flags not at the start of the + expression + +Backported from 0.13-dev +--- + bottle.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/bottle.py b/bottle.py +index fd663f7..dae4f56 100644 +--- a/bottle.py ++++ b/bottle.py +@@ -3420,7 +3420,7 @@ class StplParser(object): + _re_cache = {} #: Cache for compiled re patterns + # This huge pile of voodoo magic splits python code into 8 different tokens. + # 1: All kinds of python strings (trust me, it works) +- _re_tok = '((?m)[urbURB]?(?:\'\'(?!\')|""(?!")|\'{6}|"{6}' \ ++ _re_tok = '([urbURB]?(?:\'\'(?!\')|""(?!")|\'{6}|"{6}' \ + '|\'(?:[^\\\\\']|\\\\.)+?\'|"(?:[^\\\\"]|\\\\.)+?"' \ + '|\'{3}(?:[^\\\\]|\\\\.|\\n)+?\'{3}' \ + '|"{3}(?:[^\\\\]|\\\\.|\\n)+?"{3}))' +@@ -3443,8 +3443,9 @@ class StplParser(object): + # Match the start tokens of code areas in a template + _re_split = '(?m)^[ \t]*(\\\\?)((%(line_start)s)|(%(block_start)s))(%%?)' + # Match inline statements (may contain python strings) +- _re_inl = '%%(inline_start)s((?:%s|[^\'"\n]*?)+)%%(inline_end)s' % _re_inl +- ++ _re_inl = '(?m)%%(inline_start)s((?:%s|[^\'"\n]*?)+)%%(inline_end)s' % _re_inl ++ _re_tok = '(?m)' + _re_tok ++ + default_syntax = '<% %> % {{ }}' + + def __init__(self, source, syntax=None, encoding='utf8'): +-- +2.39.0.windows.2 + diff --git a/python-bottle.spec b/python-bottle.spec index 35d2799..b20e69b 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -1,6 +1,6 @@ Name: python-bottle Version: 0.12.13 -Release: 10 +Release: 11 Summary: WSGI micro web-framework for Python. License: MIT URL: http://bottlepy.org @@ -9,6 +9,7 @@ Patch0000: CVE-2020-28473.patch #https://github.com/bottlepy/bottle/commit/e140e1b54da721a660f2eb9d58a106b7b3ff2f00 Patch0001: CVE-2022-31799.patch Patch0002: 0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch +Patch0003: 0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch BuildArch: noarch BuildRequires: python2-devel python2-setuptools python3-devel python3-setuptools @@ -63,6 +64,9 @@ sed -i '/^#!/d' bottle.py %{python3_sitelib}/* %changelog +* Wed Nov 22 2023 zhangliangpengkun - 0.12.13-11 +- Fix #930: DeprecationWarning: Flags not at the start of the expression + * Thu Nov 02 2023 zhangliangpengkun - 0.12.13-10 - fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation. -- Gitee