minrk / wurlitzer

Capture C-level stdout/stderr in Python
MIT License
194 stars 24 forks source link

Tests fail on ppc64el: PAGESIZE is 65536 > 32768 #55

Closed juliangilbey closed 2 years ago

juliangilbey commented 2 years ago

As reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002588 the wurlitzer package tests fail on the ppc64el architecture. The reason is this:

[ppc64el]$ getconf PAGESIZE
65536

Then the test.py code:

    bufsize = 32768  # seems to only accept powers of two?
    with wurlitzer.pipes(bufsize=bufsize) as (stdout, stderr):

doesn't use a bufsize of 32768, as according to fcntl(1): "Attempts to set the pipe capacity below the page size are silently rounded up to the page size."

I'm happy to skip this test on ppc64el, but a better solution might be to change the bufsize setting to 2**18, for example, as this should work on all current architectures and will still exercise the test.