pysaml2 icon indicating copy to clipboard operation
pysaml2 copied to clipboard

Python 3.13 Compatibility (cgi, dbm.sqlite)

Open ephes opened this issue 10 months ago • 2 comments

Closes #976

Description

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.

The feature or problem addressed by this PR

After some investigation, I found two issues:

  • removal of the cgi module in Python 3.13 #976
  • dbm.sqlite being the new default dbm backend introduced in Python 3.13
What your changes do and why you chose this solution

This PR removes remaining usages of the deprecated cgi module and uses dbm.gnu as the default dbm backend which is used by _shelve_compat.

Checklist

  • [x] Checked that no other issues or pull requests exist for the same issue/change
  • [ ] Added tests covering the new functionality
  • [x] Updated documentation OR the change is too minor to be documented
  • [x] Updated CHANGELOG.md OR changes are insignificant

Hmm, this is actually kind of hard to test..

ephes avatar Feb 13 '25 16:02 ephes

I started looking for 3.13 and pysaml2 and saw this PR opened 1 hour ago :)

kushaldas avatar Feb 13 '25 17:02 kushaldas

Related thread: https://github.com/python/cpython/issues/100414

kushaldas avatar Feb 16 '25 10:02 kushaldas

Also related thread: https://discuss.python.org/t/new-default-preferred-dbm-backend/44228/4

c00kiemon5ter avatar Oct 07 '25 16:10 c00kiemon5ter

uhm, I pushed and ended up syncing ephes:master with pysaml2:master instead of adding changes.. This resulted in the PR being closed.

I create a new PR #1007 which I intend to merge.

c00kiemon5ter avatar Oct 07 '25 18:10 c00kiemon5ter