Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 397387

Summary: dev-python/odfpy-0.9.4/ suffers a test failure build with pypy-1.7
Product: Gentoo Linux Reporter: Ian Delaney (RETIRED) <idella4>
Component: Current packagesAssignee: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Status: RESOLVED OBSOLETE    
Severity: normal CC: python
Priority: Normal Keywords: TESTFAILURE
Version: 10.0   
Hardware: All   
OS: Linux   
URL: https://bugs.pypy.org/issue1165
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: my emerge --info
the build log

Description Ian Delaney (RETIRED) gentoo-dev 2012-01-02 13:42:06 UTC
Created attachment 297669 [details]
my emerge --info

FEATURES test set; std use flags'

FAILED (errors=1)
 * testwrite.py failed with PyPy 1.7 (Python 2.7)
PYTHONPATH="../build-2.7-pypy-1.7/lib" pypy-c1.7 testxhtml.py
..........
----------------------------------------------------------------------
Ran 10 tests in 1.955s

OK
PYTHONPATH="../build-2.7-pypy-1.7/lib" pypy-c1.7 testxmlgen.py
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2012-01-02 13:42:43 UTC
Created attachment 297671 [details]
the build log
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2012-06-11 15:08:56 UTC
shan't bother with a patch; this will do.

diff -ur ../odfpy.orig/odfpy-0.9.4.ebuild ../odfpy/odfpy-0.9.4.ebuild
--- ../odfpy.orig/odfpy-0.9.4.ebuild	2012-06-11 22:41:58.580465974 +0800
+++ ../odfpy/odfpy-0.9.4.ebuild	2012-06-11 22:22:40.931407732 +0800
@@ -25,7 +25,9 @@
 
 src_prepare() {
 	distutils_src_prepare
-	epatch "${FILESDIR}/${P}-tests.patch"	
+	epatch "${FILESDIR}/${P}-tests.patch" \
+	"${FILESDIR}/${P}-opendoc.patch"
+	
 }
 
 src_test() {

-------------------------------------------------------------------------------
from https://bugs.pypy.org/issue1165;

archtester odfpy # cat files/files/odfpy-0.9.4-opendoc.patch
diff -ur odfpy-0.9.4.orig/odf/opendocument.py odfpy-0.9.4/odf/opendocument.py
--- odf/opendocument.py	2011-12-15 03:05:07.000000000 +0800
+++ opendocument.py	2012-06-11 22:19:12.291397236 +0800
@@ -408,6 +408,7 @@
         """
         zipoutputfp = zipfile.ZipFile(outputfp,"w")
         self.__zipwrite(zipoutputfp)
+        zipoutputfp.close()
 
     def __zipwrite(self, outputfp):
         """ Write the document to an open file pointer

yields

 * Testing of dev-python/odfpy-0.9.4 with CPython 2.6...
 * Running testchart.py ...

 * Testing of dev-python/odfpy-0.9.4 with PyPy 1.8 (Python 2.7)...
 * Running testchart.py ...

 * Testing of dev-python/odfpy-0.9.4 with PyPy 1.9 (Python 2.7)...
 * Running testchart.py ...

OK
 * Running testxmlgen.py ...
....
----------------------------------------------------------------------
Ran 4 tests in 0.011s

OK

perfect score. Note this is a patch to odfpy itself, not to pypy

This is a bug in odfpy, not in PyPy: in odf/opendocument.py line 409, in
write(), the opened ZipFile is never close()d......................
You don't have this effect with PyPy.  The fix
is to add "zipoutputfp.close()" in the end of the write() method.
Comment 3 Mathy Vanvoorden 2016-11-03 21:17:17 UTC
This bug can be closed, version 0.9.4 is no longer in portage, latest version 1.3.2 builds the tests just fine.