Skip to content

Improve debugging of the _sre module #106508

Closed
@serhiy-storchaka

Description

@serhiy-storchaka

If macro VERBOSE is defined during compiling the _sre module, debugging prints are added which help to debug internals of the regular expression engine. Unfortunately, it is a global option which affects evaluation of every regular expression. Since some Python code which uses regular expressions is executed at make, it makes building much more slower. Also, some regular expressions are used at the REPR startup, which adds a lot of noise. It makes this feature almost not usable.

The proposed PR allows to enable tracing on per-pattern basis. If macro VERBOSE == 1, tracing is only enabled for patterns compiled with the DEBUG flag. If VERBOSE == 2, tracing is always enabled, if VERBOSE == 0 it is always disabled.

This feature is for core developers only.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesbuildThe build process and cross-buildextension-modulesC modules in the Modules dirtopic-regex

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions