New submission from Mitchell Model <m...@acm.org>:

response = urllib.request.open(someURL)
    page = response.read()

close() be called on response after the read(), right?  Experimentation 
shows that I can repeatedly read from response until I close it, getting 
back empty bytes objects.

Thinking that anything with a close() should support the with statement, 
I tried putting  the code inside one but got
        AttributeError: 'addinfourl' object has no attribute '__exit__'
so I can see that it doesn't support with. It seems like it should.

----------
components: Library (Lib)
messages: 83174
nosy: MLModel
severity: normal
status: open
title: urllib.response.addinfourl does not support __exit__
type: behavior
versions: Python 3.0, Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5418>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to