geopython / pywps

PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
https://pywps.org
MIT License
175 stars 117 forks source link

Fix WPS execute outputs parsing assuming string #623

Closed fmigneault closed 3 years ago

fmigneault commented 3 years ago

Related Issue / Discussion

When parsing the XML of the WPS execute request (in parse_post_execute): https://github.com/geopython/pywps/blob/88d2d4d5d0b4c1d1c39b0eaacf3e22d0b835d01b/pywps/app/WPSRequest.py#L280 The outputs that do not provide a mimetype explicitly are defaulted to None: https://github.com/geopython/pywps/blob/88d2d4d5d0b4c1d1c39b0eaacf3e22d0b835d01b/pywps/app/WPSRequest.py#L590

When those output definitions eventually reach the following call, the field mimetype exists and is None, making both the mimetype != '' compare and 'MimeType ' + mimetype + ' not valid' fail (raises cannot concatenate non-string). https://github.com/geopython/pywps/blob/cd71ee76c0f425e1267c842713bb634f800e7e2a/pywps/app/Process.py#L453-L479

This PR simply sets it to the default ''

Additional Information

Contribution Agreement

(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 0.0% when pulling 9e9dc236a96c986312b1987b4c94fa0c3bafbe79 on fmigneault:fix-mimetype-none into 16355299bc3147dd8215d0d13b78c49b4380c50e on geopython:pywps-4.4.

cehbrecht commented 3 years ago

@fmigneault thanks :) Should we do a cherry-pick to bring this to the main branch?

fmigneault commented 3 years ago

@cehbrecht Yes. I believe this will still be an issue in main.