Skip to content

svgtoipe gives SyntaxWarning #70

@saveriob

Description

@saveriob

On Ubuntu 24.04.2 LTS, Python 3.12.3, invoking svgtoipe gives

/usr/bin/svgtoipe:130: SyntaxWarning: invalid escape sequence '\.'
  return re.findall("([A-Za-z]|-?[0-9]+\.?[0-9]*(?:e-?[0-9]*)?)", string)
/usr/bin/svgtoipe:181: SyntaxWarning: invalid escape sequence '\.'
  d = re.findall("([A-Za-z]|-?(?:\.[0-9]+|[0-9]+\.?[0-9]*)(?:e-?[0-9]+)?)", d)
/usr/bin/svgtoipe:275: SyntaxWarning: invalid escape sequence '\('
  d = re.findall("[a-zA-Z]+\([^)]*\)", txt)
/usr/bin/svgtoipe:701: SyntaxWarning: invalid escape sequence '\('
  mat = re.match("url\(#([^)]+)\).*", fill)
/usr/bin/svgtoipe:936: SyntaxWarning: invalid escape sequence '\('
  mat = re.match("url\(#([^)]+)\).*", node.getAttribute("clip-path"))

The bug can be fixed by making those strings raw. For example, line 130 becomes

  return re.findall(r"([A-Za-z]|-?[0-9]+\.?[0-9]*(?:e-?[0-9]*)?)", string)

and so on.

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