How to except the unexpected?

Jorge Godoy godoy at ieee.org
Sat Mar 4 07:25:22 EST 2006


Rene Pijlman <reply.in.the.newsgroup at my.address.is.invalid> writes:

> With low coverage, yes. But unit testing isn't the answer for this
> particular problem. For example, yesterday my app was surprised by an
> httplib.InvalidURL since I hadn't noticed this could be raised by
> robotparser (this is undocumented). If that fact goes unnoticed when

It isn't undocumented in my module.  From 'pydoc httplib':


CLASSES
    exceptions.Exception
        HTTPException
            BadStatusLine
            ImproperConnectionState
                CannotSendHeader
                CannotSendRequest
                ResponseNotReady
            IncompleteRead
            InvalidURL                             <-------  HERE
            NotConnected
            UnimplementedFileMode
            UnknownProtocol
            UnknownTransferEncoding
        HTTPException
            BadStatusLine
            ImproperConnectionState
                CannotSendHeader
                CannotSendRequest
                ResponseNotReady
            IncompleteRead
            InvalidURL
            NotConnected
            UnimplementedFileMode
            UnknownProtocol
            UnknownTransferEncoding
    HTTP
    HTTPConnection
        HTTPSConnection
    HTTPResponse


(Yes, it appears twice, don't ask me why...)

-- 
Jorge Godoy      <godoy at ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.



More information about the Python-list mailing list