You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thank you for this amazing library! I recently wrote a blog post demonstrating how to use Django as a service provider, with pysaml2 serving as an example IdP. A reader has since pointed out that it doesn’t work with Python 3.13, and after some investigation, I suspect the issue stems from the removal of the cgi module in Python 3.13.
I noticed that pysaml2 still imports cgi in a couple of places. For example:
In src/saml2/httputil.py:
# The `cgi` module is used here:formdata=cgi.parse(environ["wsgi.input"], environ, empty, err)
# Since `parse_qs` is already imported, this could potentially be replaced with:input_stream=environ["wsgi.input"]
content_length=int(environ.get("CONTENT_LENGTH", 0))
form_data_bytes=input_stream.read(content_length)
form_data=parse_qs(form_data_bytes.decode('utf-8'))
In src/saml2/pack.py and src/saml2/httputil.py:
# The fallback to `cgi` for HTML escaping could be removed, as the `html` module # (introduced in Python 3.4) provides the necessary functionality:try:
importhtmlexceptException:
importcgiashtml# type: ignore[no-redef]
Would it make sense to update these references to make pysaml2 compatible with Python 3.13? I’d be happy to help test any changes.
Best regards,
Jochen
The text was updated successfully, but these errors were encountered:
Hi there,
First off, thank you for this amazing library! I recently wrote a blog post demonstrating how to use Django as a service provider, with pysaml2 serving as an example IdP. A reader has since pointed out that it doesn’t work with Python 3.13, and after some investigation, I suspect the issue stems from the removal of the cgi module in Python 3.13.
I noticed that pysaml2 still imports cgi in a couple of places. For example:
In src/saml2/httputil.py:
In src/saml2/pack.py and src/saml2/httputil.py:
Would it make sense to update these references to make pysaml2 compatible with Python 3.13? I’d be happy to help test any changes.
Best regards,
Jochen
The text was updated successfully, but these errors were encountered: