[Fedora-suds-list] Contribute to ticket 316

Paolo Mossino paolo.mossino at gmail.com
Tue Sep 21 15:11:33 UTC 2010


Hello,

   my name is Paolo Mossino, using SUDS, I discover a problem in method
failed of suds/client.py file.

It seems to be the same problem as reported by ticket 316 (
https://fedorahosted.org/suds/ticket/316).

Sorry to disturb here, but I was unable to add my contributes via online
ticketing system.
The link for creating a new ticket (link
https://fedorahosted.org/suds/newticket) fails since I've not enouth
permissions ("*TICKET_CREATE privileges are required to perform this
operation*"). I also try to create a Fedora account, but I'm not able to
found a way to submit a bug to SUDS from the fedoraproject.org web
interface.

I want to contribute to this ticket by adding a use cases for the bug and
proposing a patch.

I discover this bug trying to connect to a WSDL protected by basic HTTP
authentication, but providing wrong credentials.

As reported by ticket 316, the bug is at the beginning of method failed
(comments pruned, problem in *bold*):

def failed(self, binding, error):
>     status, reason = (error.httpcode, tostr(error))
> *    reply = error.fp.read()*
>

The code try to read from error.fp without checking if it's None.
If I understand correctly, this information is mainly used for providing
information to the exception raised... this means that we can simply and
safely provide a default (empty?) value if fp is None.

My patch proposal is simple:

- reply = error.fp.read()
+ if error.fp is None:
+     reply = ''
+ else:
+     reply = error.fp.read()


Thank you in advance and Kind Regards,

-- 
Dr. Paolo Mossino  <paolo.mossino at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/suds/attachments/20100921/91231238/attachment.html 


More information about the suds mailing list