Accessing browser.headers before the first request generates an error.
Bug #605907 reported by
Benji York
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.testbrowser |
Invalid
|
Undecided
|
Unassigned |
Bug Description
>>> import zope.testbrowse
>>> b = zope.testbrowse
>>> b.headers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
return self.mech_
AttributeError: 'NoneType' object has no attribute 'info'
>>> b.open('http://
>>> b.headers
<httplib.
To post a comment you must log in.
For comparison purposes:
- Accessing b.contents raises AttributeError: 'NoneType' object has no attribute 'tell' _mechanize. BrowserStateErr or: not viewing any document
- Accessing b.url, b.title, b.isHtml, or calling b.getForm(), b.getControl(), b.getLink() all raise mechanize.
I don't really care about this, but I suppose it would make sense to have both b.contents and b.headers also raise BrowserStateError before you make the first request.