backport GH#530 to fix #1408282 (crash with Python 3.6)

Doing this as a downstream patch as all maintainers appear to
be on end-of-year PTO already, and I don't want composes broken
all the way till the new year.
This commit is contained in:
Adam Williamson 2016-12-23 08:59:56 -08:00
parent b38e11a345
commit aa0a158423
2 changed files with 37 additions and 1 deletions

30
530.patch Normal file
View File

@ -0,0 +1,30 @@
From 67d36789c8ff88b4ba14da7022f63b6831d75da3 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 22 Dec 2016 15:09:47 -0800
Subject: [PATCH] Shallow copy another alignment property (#1408282)
Several blivet classes use custom __deepcopy__ methods to avoid
deep copying some parted objects which we know can't be deep
copied. Unfortunately the list of attributes excepted from deep
copying for `DiskLabel` was missing one parted Alignment object,
and with Python 3.6, we blow up trying to deepcopy that. This
fixes the problem by adding that attribute to the list of ones
we know have to be shallow copied.
---
blivet/formats/disklabel.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
index f6b9d83..2dad706 100644
--- a/blivet/formats/disklabel.py
+++ b/blivet/formats/disklabel.py
@@ -90,7 +90,8 @@ def __deepcopy__(self, memo):
We can't do copy.deepcopy on parted objects, which is okay.
"""
return util.variable_copy(self, memo,
- shallow=('_parted_device', '_optimal_alignment', '_minimal_alignment',),
+ shallow=('_parted_device', '_optimal_alignment', '_minimal_alignment',
+ '_disk_label_alignment'),
duplicate=('_parted_disk', '_orig_parted_disk'))
def __repr__(self):

View File

@ -5,7 +5,7 @@ Version: 2.1.7
#%%global prerelease .b1
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 4%{?prerelease}%{?dist}
Release: 5%{?prerelease}%{?dist}
Epoch: 1
License: LGPLv2+
Group: System Environment/Libraries
@ -14,6 +14,9 @@ Group: System Environment/Libraries
Source0: http://github.com/rhinstaller/blivet/archive/%{realname}-%{realversion}.tar.gz
Patch0: 0001-Fix-unknown-SAS-device-sysfs-parsing.patch
# Fix crash with Python 3.6:
# https://bugzilla.redhat.com/show_bug.cgi?id=1408282
Patch1: https://github.com/rhinstaller/blivet/pull/530.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -84,6 +87,9 @@ make PYTHON=%{__python3} DESTDIR=%{buildroot} install
%{python3_sitelib}/*
%changelog
* Fri Dec 23 2016 Adam Williamson <awilliam@redhat.com> - 1:2.1.7-5
- backport GH#530 to fix #1408282 (crash with Python 3.6)
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1:2.1.7-4
- Rebuild for Python 3.6