From 268b1571b34436653e1ca506d09ab15a16cf5ac9 Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Mon, 10 Jun 2019 11:24:27 +0200 Subject: [PATCH] Avoid invalid unicode escape sequences in Py3.8 --- pycparser-2.14-rstring_fix.patch | 14 ++++++++++++++ python-pycparser.spec | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pycparser-2.14-rstring_fix.patch diff --git a/pycparser-2.14-rstring_fix.patch b/pycparser-2.14-rstring_fix.patch new file mode 100644 index 0000000..2385ad3 --- /dev/null +++ b/pycparser-2.14-rstring_fix.patch @@ -0,0 +1,14 @@ +diff -ru pycparser-release_v2.14/pycparser/c_lexer.py pycparser-release_v2.14_patched/pycparser/c_lexer.py +--- pycparser-release_v2.14/pycparser/c_lexer.py 2019-06-06 15:51:41.937286040 +0200 ++++ pycparser-release_v2.14_patched/pycparser/c_lexer.py 2019-06-06 15:53:15.269120067 +0200 +@@ -52,8 +52,8 @@ + # Allow either "# line" or "# " to support GCC's + # cpp output + # +- self.line_pattern = re.compile('([ \t]*line\W)|([ \t]*\d+)') +- self.pragma_pattern = re.compile('[ \t]*pragma\W') ++ self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') ++ self.pragma_pattern = re.compile(r'[ \t]*pragma\W') + + def build(self, **kwargs): + """ Builds the lexer from the specification. Must be diff --git a/python-pycparser.spec b/python-pycparser.spec index 588e386..77bf7d8 100644 --- a/python-pycparser.spec +++ b/python-pycparser.spec @@ -9,12 +9,14 @@ Name: python-pycparser Summary: C parser and AST generator written in Python Version: 2.14 -Release: 18%{?dist} +Release: 19%{?dist} License: BSD URL: http://github.com/eliben/pycparser Source0: http://github.com/eliben/pycparser/archive/release_v%{version}.tar.gz Source1: pycparser-0.91.1-remove-relative-sys-path.py +Patch0: pycparser-2.14-rstring_fix.patch + Patch100: pycparser-2.10-ply.patch # This is Fedora-specific; I don't think we should request upstream to # remove embedded libraries from their distribuution, when we can remove @@ -64,6 +66,7 @@ need to parse C source code. %prep %setup -q -n pycparser-release_v%{version} +%patch0 -p1 %patch100 -p1 -F5 -b .ply # remove embedded copy of ply @@ -115,6 +118,9 @@ popd %endif # with_python3 %changelog +* Mon Jun 10 2019 Marcel Plch - 2.14-19 +- Avoid invalid unicode escape sequences in Py3.8 + * Tue Feb 26 2019 Christian Heimes - 2.14-18 - Add build dependency on cpp for unit tests - Add dependency on python-ply version to prevent "yacc table file version is out of date"