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_wave: failures on PPC64 buildbot #63832
Comments
Some test_wave are failing, but only on PPC64 (big endian, right?). It may be related to issue bpo-1575020. http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.x/builds/1099/steps/test/logs/stdio ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 243, in test_unseekable_incompleted_write
self.check_file(testfile, self.nframes + 1, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 84, in check_file
self.assertEqual(f.readframes(nframes), frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/wave.py", line 257, in readframes
data.fromfile(chunk.file.file, nitems)
EOFError: read() didn't return enough bytes ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 243, in test_unseekable_incompleted_write
self.check_file(testfile, self.nframes + 1, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 84, in check_file
self.assertEqual(f.readframes(nframes), frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/wave.py", line 257, in readframes
data.fromfile(chunk.file.file, nitems)
EOFError: read() didn't return enough bytes ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 163, in test_write_array
self.check_file(TESTFN, self.nframes, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
self.assertEqual(f.getnframes(), nframes)
AssertionError: 96 != 48 ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 171, in test_write_memoryview
self.check_file(TESTFN, self.nframes, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
self.assertEqual(f.getnframes(), nframes)
AssertionError: 96 != 48 ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 163, in test_write_array
self.check_file(TESTFN, self.nframes, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
self.assertEqual(f.getnframes(), nframes)
AssertionError: 192 != 48 ====================================================================== Traceback (most recent call last):
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 171, in test_write_memoryview
self.check_file(TESTFN, self.nframes, self.frames)
File "/home/shager/cpython-buildarea/3.x.edelsohn-powerlinux-ppc64/build/Lib/test/audiotests.py", line 83, in check_file
self.assertEqual(f.getnframes(), nframes)
AssertionError: 192 != 48 |
Thank you for your report. This patch should fix the issue. |
I don't understand why it would change anything. According to the doc, passing data to the construction is like calling array.frombytes(): If it behaves differently, it looks like a bug a in the array module. Am I wrong? |
array's constructor interprets its second memoryview argument as an iterable of integers. >>> import array
>>> array.array('h', b'abcd')
array('h', [25185, 25699])
>>> array.array('h', memoryview(b'abcd'))
array('h', [97, 98, 99, 100]) array.frombytes() always interpret its argument as bytes-like object. >>> a = array.array('h')
>>> a.frombytes(memoryview(b'abcd'))
>>> a
array('h', [25185, 25699]) First patch fixes only a half of the issue. test_unseekable_incompleted_write() still failed because array.fromfile() fails read incomplete data. Second patch also adds unittest.expectedFailure decorators for these tests. |
Ok so, so your fix is correct.
Why the test succeeded on little endian? |
Because array.fromfile() is used only to swap 16- and 32-bit samples on bigendian platform. Perhaps we need the byteswap() function in the audioop module. |
If the file is truncated, why would the test suceed on little endian? The file doesn't have the same size in bytes? The test doesn't check the number of frames? |
Because this code is not used on little endian. On little endian a data is |
By the way, test_wave also fails on zLinux, which also is Big Endian. |
New changeset 7b040bc289e8 by Serhiy Storchaka in branch '3.3': New changeset 7cf7f19445ba by Serhiy Storchaka in branch 'default': New changeset 03a32ead9c7d by Serhiy Storchaka in branch '2.7': |
"PPC64 PowerLinux 3.x" buildbot is green again! I'm closing the issue. I didn't check 2.7 and 3.3 buildbots. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: