Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_bz2 fails with BrokenPipeError when bunzip2 is missing #72850

Closed
xdegaye mannequin opened this issue Nov 11, 2016 · 4 comments
Closed

test_bz2 fails with BrokenPipeError when bunzip2 is missing #72850

xdegaye mannequin opened this issue Nov 11, 2016 · 4 comments
Labels
3.7 tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 11, 2016

BPO 28664
Nosy @xdegaye, @serhiy-storchaka
Files
  • decompress.patch
  • test_bz2-cmdline-bunzip2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-11-11.16:18:06.080>
    created_at = <Date 2016-11-11.09:14:31.770>
    labels = ['3.7', 'type-bug', 'tests']
    title = 'test_bz2 fails with BrokenPipeError when bunzip2 is missing'
    updated_at = <Date 2016-11-11.16:18:06.079>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2016-11-11.16:18:06.079>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-11-11.16:18:06.080>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2016-11-11.09:14:31.770>
    creator = 'xdegaye'
    dependencies = []
    files = ['45440', '45441']
    hgrepos = []
    issue_num = 28664
    keywords = ['patch']
    message_count = 4.0
    messages = ['280569', '280573', '280582', '280588']
    nosy_count = 4.0
    nosy_names = ['nadeem.vawda', 'xdegaye', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28664'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 11, 2016

    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.

    @xdegaye xdegaye mannequin added 3.7 tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Nov 11, 2016
    @serhiy-storchaka
    Copy link
    Member

    serhiy-storchaka commented Nov 11, 2016

    Wouldn't be better to check once the existence of the bunzip2 executable? Proposed patch also simplifies invocation of the bunzip2 command.

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 11, 2016

    Much better indeed :)
    With this patch, the test runs fine on Android.
    I left some minor comments on rietveld.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 11, 2016

    New changeset 648cd8450f4f by Serhiy Storchaka in branch '3.5':
    Issue bpo-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 bpo-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 bpo-28664: test_bz2 now works on non-Windows platforms without bunzip2
    https://hg.python.org/cpython/rev/969e85a7a943

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant