Skip to content

Commit

Permalink
IdentityPython#976 need to avoid dbm.sqlite which is default in Pytho…
Browse files Browse the repository at this point in the history
…n >= 3.13
  • Loading branch information
ephes committed Feb 13, 2025
1 parent 175a450 commit 39f352a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/saml2/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,18 @@
}


def _avoid_dbm_sqlite():
"""
Force dbm.gnu to be used instead of dbm.sqlite because of threading issues when
running idp_server.py. The dbm.sqlite is the default dbm module used by Python >= 3.13
"""
import dbm.gnu
import dbm
dbm._defaultmod = dbm.gnu


def _shelve_compat(name, *args, **kwargs):
_avoid_dbm_sqlite()
try:
return shelve.open(name, *args, **kwargs)
except dbm.error[0]:
Expand Down

0 comments on commit 39f352a

Please sign in to comment.