mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.87k stars 579 forks source link

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

Open lammas opened 1 year ago

lammas commented 1 year ago

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 commented 1 year ago

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