Message201239
I can't reproduce the access violation on Windows, using Python 2.7.3.
Using the test_bufio.py script by santa4nt, I can see that the fail still happens.
As Santoso Wijaya (santa4nt) said in a previous comment:
The `write(data)` method is getting a `memoryview` object, thus the test code should be using `data.tobytes()` instead of using `bytes(data)`. If we introduce that logic on the test_bufio.py script it passes.
The thing is that if we, instead of doing `import io` (the C version of the module) we do `import _pyio as io` (the pure Python version) the FAIL does not appears at all in the original script!
That difference ("`write` might receive a `memoryview` object if using the C version of this module") is not documented anywhere.
It should, if that's the expected behavior [*], and the code using the io module is responsible for using .tobytes() instead of bytes().
[*] Why "_pyio.py" behaves differently? |
|
Date |
User |
Action |
Args |
2013-10-25 14:33:26 | OscarL | set | recipients:
+ OscarL, pitrou, christian.heimes, benjamin.peterson, santoso.wijaya |
2013-10-25 14:33:26 | OscarL | set | messageid: <1382711606.58.0.151189686921.issue12340@psf.upfronthosting.co.za> |
2013-10-25 14:33:26 | OscarL | link | issue12340 messages |
2013-10-25 14:33:26 | OscarL | create | |
|