URLError handling with urllib can fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Low
|
Vincent Ladeuil |
Bug Description
On Thu, 2006-08-31 at 18:49 +0200, Christian Bjälevik wrote:
> Format <RepositoryFormat6> for
> http://
> bzr: ERROR: exceptions.
> attribute 'code'
> ...
> File
> "/usr/lib/
> line 117, in has
> mutter('url error code: %s for has url: %r', e.code, abspath)
> AttributeError: URLError instance has no attribute 'code'
> bzr 0.9.0 on python 2.4.3.final.0 (linux2)
> arguments: ['/usr/bin/bzr', 'branch',
> 'http://
Looks like a HTTP error of some sort happened during access to the
branch, and it did not have a .code attribute so rather than being
handled it threw all the way up.
mvo should do 'bzr upgrade' to that branch as a separate issue.
affects /products/bzr
--
GPG key available at: <http://
I encounter the same scenario while working on the urllib-based webdav plugin implementation.
It occurs more often when a connection is kept alive.
The error is caused by:
- the server not responding,
- httplib trying to read the status line, failing and throwing a BadStatusLine exception.
So of course there is no 'code', it's part of the status line.
Also, Robert is right, it's an HTTP error.
If this bug becomes critical, I can try to provide a patch, but I doubt it, it occurs pretty rarely.