Skip to content

SyntaxWarning on Python 3.14: invalid escape sequences in pdfstring.py docstring not yet released to PyPI #19

Description

@Tschuppi81

Issue

On Python 3.14, importing pdfrw emits a SyntaxWarning at startup:

/app/lib/python3.14/site-packages/pdfrw/objects/pdfstring.py:375: SyntaxWarning: "\[" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\["? A raw string is also an option.

The fix is already present in the master branch (commit 726d848 — "Fix docstring escape sequences"), but has not been included in a PyPI release yet. The current PyPI release pdfrw2 0.5.0 still contains the unfixed docstring:

    1. \[nrtbf\()]: simple escapes

Request

Could you cut a new pdfrw2 release that includes commit 726d848?

In Python 3.14 these are SyntaxWarnings; they are expected to become SyntaxErrors in a future Python version, so this will eventually break installations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions