diff --git a/PyGreSQL-5.0.3-python-3.6.patch b/PyGreSQL-5.0.3-python-3.6.patch new file mode 100644 index 0000000..20ba7a8 --- /dev/null +++ b/PyGreSQL-5.0.3-python-3.6.patch @@ -0,0 +1,28 @@ +From 7fe2cc4d84d37e29f256fd8f614861121a2da254 Mon Sep 17 00:00:00 2001 +From: Christoph Zwerschke +Date: Fri, 6 Jan 2017 16:36:05 +0000 +Subject: [PATCH] Fix an issue with Python 3.6 + +While running over a dictionary in a for loop, we altered its values. +This used to work perfectly well in Python before 3.6, but now causes +problems, probably due to internal optimizations. We avoid this now. +--- + pg.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pg.py b/pg.py +index 117e440..5942d50 100644 +--- a/pg.py ++++ b/pg.py +@@ -708,7 +708,7 @@ class Adapter: + # so we first must find the values actually used in the command + used_values = {} + literals = dict.fromkeys(values, '') +- for key in literals: ++ for key in values: + del literals[key] + try: + command % literals +-- +2.9.3 + diff --git a/PyGreSQL.spec b/PyGreSQL.spec index 4755ae0..229c4bf 100644 --- a/PyGreSQL.spec +++ b/PyGreSQL.spec @@ -5,7 +5,7 @@ Name: %{srcname} Version: 5.0.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: %{sum} Group: Applications/Databases @@ -19,6 +19,8 @@ License: PostgreSQL or Python Source0: http://www.pygresql.org/files/PyGreSQL-%{version}.tar.gz +Patch0: %name-5.0.3-python-3.6.patch + # PyGreSQL was originally shipped as a sub-RPM of the PostgreSQL package; # these Provides/Obsoletes give a migration path. Note there is no # intention of changing the version numbers in future. @@ -106,6 +108,9 @@ EOF %changelog +* Fri Feb 17 2017 Pavel Raiskup - 5.0.3-4 +- fix nasty undefined behavior (rhbz#1423108) + * Fri Feb 10 2017 Fedora Release Engineering - 5.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild