python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

IndexError when parsing a response with an empty <Soap:Body/>

Open lammas opened this issue 3 years ago • 1 comments

Hi I encountered a strange SOAP endpoint that in some cases (e.g. no results) returns an empty body element. When that happens we reach this point and an empty list gets indexed at element 0: https://github.com/mvantellingen/python-zeep/blob/master/src/zeep/wsdl/messages/soap.py#L435-L439

The issue can be reproduced in 4.1.0. Tested with Python 3.9.2.

Attached is a self-contained example to reproduce the issue (had to rename the file because Github doesn't allow .py file extension for some reason). repro.py.log

lammas avatar Aug 18 '22 12:08 lammas

On a second look I noticed that there's already a PR addressing this: #1287 Eagerly awaiting this to be merged. :)

lammas avatar Aug 18 '22 12:08 lammas