• Jeremy Hylton's avatar
    Fix HTTPError __init__ for cases where fp is None. · 40bbae3b
    Jeremy Hylton yazdı
    The HTTPError class tries to act as a regular response objects for
    HTTP protocol errors that include full responses.  If the failure is
    more basic, like no valid response, the __init__ choked when it tried
    to initialize its superclasses in addinfourl hierarchy that requires a
    valid response.
    
    The solution isn't elegant but seems to be effective.  Do not
    initialize the base classes if there isn't a file object containing
    the response.  In this case, user code expecting to use the addinfourl
    methods will fail; but it was going to fail anyway.
    
    It might be cleaner to factor out HTTPError into two classes, only one
    of which inherits from addinfourl.  Not sure that the extra complexity
    would lead to any improved functionality, though.
    
    Partial fix for SF bug # 563665.
    
    Bug fix candidate for 2.1 and 2.2.
    40bbae3b
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...