Skip to content

Upgrading sqlparse 0.4 to 0.5

Breaking0.4.4 → 0.5.5Security4Platform3New11Changed4Fixed16Other1

BreakingUpgrade verdict

3 platform requirement changes and 4 security fixes.

  • The package can now be installed and used with Python 3.14.
  • The library no longer runs on older Python versions 3.5, 3.6, and 3.7.
  • The library now works on Python 3.12.
  • New safeguards stop maliciously complex SQL from making the parser hang; the limits can be raised or turned off for legitimate large statements.
Top 5 of 7 that need code or config changes

Python requirement changed in 0.5.0: >=3.5 → >=3.8.

Security4
Adds configurable limits (MAX_GROUPING_DEPTH=100, MAX_GROUPING_TOKENS=10000) to protect against DoS when parsing large tuple lists.
MAX_GROUPING_DEPTHMAX_GROUPING_TOKENS
sqlparse: formatting list of tuples leads to denial of service
Moderate
Introduces more generalized handling of potential denial of service attacks caused by recursion errors on deeply nested statements.
Fixes a potential denial of service from recursion errors on deeply nested statements by raising SQLParseError instead.
SQLParseErrorHigh · CVSS 7.5
Platform3
Adds support for Python 3.14.
Drops support for Python 3.5, 3.6, and 3.7.
Adds support for Python 3.12.