Skip to content

Upgrading pyparsing 2 to 3

Breaking2.4.7 → 3.3.3Breaking5Platform5Deprecated4New29Changed35Fixed25Other14

Fetching 41 releases from GitHub…18 / 41
BreakingUpgrade verdict

3 breaking changes and 5 platform requirement changes.

  • transform_string now keeps whitespace as it was in the input, so output may differ from before.
  • Error messages from some parsers are now more detailed, so code that checks error message text may behave differently.
  • An IndexError thrown inside a parse action now surfaces as an IndexError instead of being converted into a parse error.
  • The library can now be used with Python 3.15.
Top 5 of 11 that need code or config changes

Python requirement changed in 3.2.0b1: >=2.6, !=3.0.*, !=3.1.*, !=3.2.* → >=3.9.

Breaking3
Fixes transform_string() not properly preserving whitespace from the input string in the output string.
transform_string()
Fixes ParseElementEnhance subclasses replacing detailed exception messages with less-specific generic messages and locations.
ParseElementEnhanceParseExceptions
Fixes IndexError raised in a parse action being incorrectly reraised as a ParseException; it now propagates as IndexError.
IndexErrorParserElementParseException
Platform5
Adds support for Python 3.15.
Supports Python 3.14 and free-threaded 3.14t, though pyparsing is not claimed to be thread-safe.
Adds support for Python 3.14.
Discontinues support for Python 3.6, 3.7, and 3.8.
Adds early testing support for Python 3.13 with JIT enabled.
Deprecated3
Version 3.3.0 begins emitting DeprecationWarnings for pyparsing methods renamed to PEP8-compliant names since 3.0.0.
pyparsing/tools/cvt_pep8_names.py-u
Deprecated indentedBlock converted by cvt_pyparsing_pep8_names emits UserWarnings that further code changes are required.
indentedBlockIndentedBlockcvt_pyparsing_pep8_names
Deprecated locatedExpr converted by cvt_pyparsing_pep8_names emits UserWarnings that code changes may be required.
locatedExprLocatedcvt_pyparsing_pep8_names