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
TextIOWrapper fails with SystemError when reading HTTPResponse #49878
Comments
import io
import urllib.request
f_bytes = urllib.request.urlopen("http://www.python.org/")
f_string = io.TextIOWrapper(f_bytes, "iso-8859-1")
print(f_string.read()) |
Fixed in r70928. |
Nope, this is not yet fixed. $ ./python
Python 3.1a1+ (py3k:70929, Mar 31 2009, 19:18:12)
[GCC 4.3.2] on linux2
...
...
>>> f_bytes = urllib.request.urlopen("http://www.python.org")
>>> f_string = io.TextIOWrapper(f_bytes,"iso-8859-1")
>>> print(f_string.read())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: not readable |
urllib.response.addinfourl doesn't seem to implement the required ABC >>> f_bytes = urllib.request.urlopen("http://www.python.org/")
>>> f_bytes.readable()
False |
I just wanted to mention that the current head of py3k returns an |
Jeremy Hylton wrote:
I guess, you meant " That doesn't mean it is *not* the right thing to |
With the changes r70935, this works. |
Please note that passing a instance of RawIOBase (as HTTPResponse) is |
I suppose it is fixed, isn't it? |
Yes |
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: