From 2f2365705fe06c5657961d0547f4e072c667e065 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 10 Oct 2012 22:39:30 -0700 Subject: [PATCH] Patch from upstream for traceback when people use this with python2 and python3 in the same directory --- python-coverage-3.5.3-pickle.patch | 19 +++++++++++++++++++ python-coverage.spec | 13 ++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 python-coverage-3.5.3-pickle.patch diff --git a/python-coverage-3.5.3-pickle.patch b/python-coverage-3.5.3-pickle.patch new file mode 100644 index 0000000..ed24d01 --- /dev/null +++ b/python-coverage-3.5.3-pickle.patch @@ -0,0 +1,19 @@ +# HG changeset patch +# User Ned Batchelder +# Date 1349312975 14400 +# Node ID 16020b834643bb8b9953b8d4bcc09691deb549b9 +# Parent 70e174f7312c87101b0b5be7ec7dd1acf7869f12 +Fix #193: The status.dat file written by py2 can't be read by py3 + +diff -r 70e174f7312c87101b0b5be7ec7dd1acf7869f12 -r 16020b834643bb8b9953b8d4bcc09691deb549b9 coverage/html.py +--- a/coverage/html.py Wed Oct 03 07:48:04 2012 -0400 ++++ b/coverage/html.py Wed Oct 03 21:09:35 2012 -0400 +@@ -281,7 +281,7 @@ + status = pickle.load(fstatus) + finally: + fstatus.close() +- except IOError: ++ except (IOError, ValueError): + usable = False + else: + usable = True diff --git a/python-coverage.spec b/python-coverage.spec index aadf5d3..5d950a8 100644 --- a/python-coverage.spec +++ b/python-coverage.spec @@ -14,11 +14,12 @@ Name: python-coverage Summary: Code coverage testing module for Python Version: 3.5.3 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD and (MIT or GPLv2) Group: System Environment/Libraries URL: http://nedbatchelder.com/code/modules/coverage.html Source0: http://pypi.python.org/packages/source/c/coverage/coverage-%{version}.tar.gz +Patch0: python-coverage-3.5.3-pickle.patch BuildRequires: python-setuptools, python-devel Requires: python-setuptools %if 0%{?with_python3} @@ -50,6 +51,8 @@ have been executed. %prep %setup -q -n coverage-%{version} +%patch0 -p1 + find . -type f -exec chmod 0644 \{\} \; sed -i 's/\r//g' README.txt @@ -73,12 +76,12 @@ popd %install %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +%{__python3} setup.py install --skip-build --root %{buildroot} mv %{buildroot}/%{_bindir}/coverage %{buildroot}/%{_bindir}/python3-coverage popd %endif # if with_python3 -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%{__python} setup.py install --skip-build --root %{buildroot} %files %doc README.txt @@ -95,6 +98,10 @@ popd %changelog +* Wed Oct 10 2012 Toshio Kuratomi - 3.5.3-2 +- Patch from upstream for traceback when people use this with python2 and + python3 in the same directory + * Mon Oct 1 2012 Tom Callaway - 3.5.3-1 - update to 3.5.3