Skip to content

Python3.12 - SyntaxWarning: invalid escape sequence '\[' #14

@davmlaw

Description

@davmlaw

In 3.12 this now gives a visible warning:

Python 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from vcf import VCFReader

In [2]: reader = VCFReader()
/home/dlawrence/localwork/variantgrid/env/lib/python3.12/site-packages/vcf/parser.py:380: SyntaxWarning: invalid escape sequence '\['
  self._alt_pattern = re.compile("[\[\]]")
/home/dlawrence/localwork/variantgrid/env/lib/python3.12/site-packages/vcf/parser.py:654: SyntaxWarning: invalid escape sequence '\['
  remoteOrientation = re.search("\[", str) is not None

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