classification
Title: test_bz2 fails with BrokenPipeError when bunzip2 is missing
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: nadeem.vawda, python-dev, serhiy.storchaka, xdegaye
Priority: normal Keywords: patch

Created on 2016-11-11 09:14 by xdegaye, last changed 2016-11-11 16:18 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
decompress.patch xdegaye, 2016-11-11 09:14 review
test_bz2-cmdline-bunzip2.patch serhiy.storchaka, 2016-11-11 10:40 review
Messages (4)
msg280569 - (view) Author: Xavier de Gaye (xdegaye) * (Python committer) Date: 2016-11-11 09:14
bunzip2 is missing on Android and the following tests of test_bz2 fail randomly: test_implicit_binary_modes, test_binary_modes and testAppend, with the following backtrace:
    ERROR: testAppend (test.test_bz2.BZ2FileTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_bz2.py", line 302, in testAppend
    self.assertEqual(self.decompress(f.read()), self.TEXT * 2)
    File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_bz2.py", line 88, in decompress
    pop.stdin.close()
    BrokenPipeError: [Errno 32] Broken pipe

Patch attached.
msg280573 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-11-11 10:40
Wouldn't be better to check once the existence of the bunzip2 executable? Proposed patch also simplifies invocation of the bunzip2 command.
msg280582 - (view) Author: Xavier de Gaye (xdegaye) * (Python committer) Date: 2016-11-11 14:29
Much better indeed :)
With this patch, the test runs fine on Android.
I left some minor comments on rietveld.
msg280588 - (view) Author: Roundup Robot (python-dev) Date: 2016-11-11 15:12
New changeset 648cd8450f4f by Serhiy Storchaka in branch '3.5':
Issue #28664: test_bz2 now works on non-Windows platforms without bunzip2
https://hg.python.org/cpython/rev/648cd8450f4f

New changeset 9184f7f11b30 by Serhiy Storchaka in branch '3.6':
Issue #28664: test_bz2 now works on non-Windows platforms without bunzip2
https://hg.python.org/cpython/rev/9184f7f11b30

New changeset 969e85a7a943 by Serhiy Storchaka in branch 'default':
Issue #28664: test_bz2 now works on non-Windows platforms without bunzip2
https://hg.python.org/cpython/rev/969e85a7a943
History
Date User Action Args
2016-11-12 11:38:54xdegayelinkissue26865 dependencies
2016-11-11 16:18:06serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-11-11 15:12:24python-devsetnosy: + python-dev
messages: + msg280588
2016-11-11 14:29:04xdegayesetmessages: + msg280582
2016-11-11 10:40:23serhiy.storchakasetfiles: + test_bz2-cmdline-bunzip2.patch
versions: + Python 3.5
nosy: + serhiy.storchaka

messages: + msg280573
2016-11-11 09:14:31xdegayecreate