Skip to content

Bad regexp in JavaMessageFormatPlaceable #3449

@jwilk

Description

@jwilk

JavaMessageFormatPlaceable contains the following code (with boring parts of the regexp snipped):

regex = re.compile(r"""...[-0#.,E;%\u2030\u00a4']...""")

But the \u escape sequence is supported by the re module only since Python 3.3. In older Python versions this regexp is equivalent to:

r"""...[-0#.,E;%234au']..."

which is definitely not what you wanted.

This bug was found using pydiatra.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions