Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-18 Thread Julian Gilbey
On Mon, Mar 18, 2024 at 12:12:06PM +, Torrance, Douglas wrote:
> Control: tags -1 - moreinfo + confirmed
> [...]
> > 
> > Oh, and just to add on to this: I believe that this will become a
> > SyntaxError in Python 3.13 or Python 3.14.
> 
> Ok, thanks for clarifying!
> 
> I was able to reproduce the warnings in Python 3.12:
> ...
> 
> They were silent using Python 3.11, which is suppose is why I hadn't seen them
> before.

Just checked the Python docs: see the second point of
https://docs.python.org/3/whatsnew/3.12.html#other-language-changes

Best wishes,

   Julian



Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-18 Thread Torrance, Douglas

Control: tags -1 - moreinfo + confirmed

On Mon 18 Mar 2024 05:54:25 AM GMT, Julian Gilbey  wrote:

On Mon, Mar 18, 2024 at 05:48:14AM +, Julian Gilbey wrote:

I was building or testing a package using sbuild or autopkgtest using
lxc, I don't remember which.  One of the dependencies was dot2tex, so
it was being installed on a clean chroot (or equivalent).  The
warnings appeared during the dpkg installation of the package
(probably during the configure step).

But either way, all of these are, indeed, syntax errors and need to be
corrected.  (It turns out, just looking at the first example on line
1236, that they cannot all be fixed by turning them into raw strings:
this string has both '\p', which should be '\\p' (with a literal
backslash), and '\n', which presumably is intended as a new line
character.


Oh, and just to add on to this: I believe that this will become a
SyntaxError in Python 3.13 or Python 3.14.


Ok, thanks for clarifying!

I was able to reproduce the warnings in Python 3.12:

$ python3.12
Python 3.12.2 (main, Mar  3 2024, 09:11:00) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import dot2tex

/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:900: SyntaxWarning: invalid 
escape sequence '\i'
 variables['<>'] = "\input{gvcols.tex}"
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1236: SyntaxWarning: invalid 
escape sequence '\p'
...

They were silent using Python 3.11, which is suppose is why I hadn't seen them
before.

Doug


signature.asc
Description: PGP signature


Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-17 Thread Julian Gilbey
On Mon, Mar 18, 2024 at 05:48:14AM +, Julian Gilbey wrote:
> I was building or testing a package using sbuild or autopkgtest using
> lxc, I don't remember which.  One of the dependencies was dot2tex, so
> it was being installed on a clean chroot (or equivalent).  The
> warnings appeared during the dpkg installation of the package
> (probably during the configure step).
> 
> But either way, all of these are, indeed, syntax errors and need to be
> corrected.  (It turns out, just looking at the first example on line
> 1236, that they cannot all be fixed by turning them into raw strings:
> this string has both '\p', which should be '\\p' (with a literal
> backslash), and '\n', which presumably is intended as a new line
> character.

Oh, and just to add on to this: I believe that this will become a
SyntaxError in Python 3.13 or Python 3.14.

Best wishes,

   Julian



Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-17 Thread Julian Gilbey
On Sun, Mar 17, 2024 at 11:44:23PM +, Torrance, Douglas wrote:
> Control: tags -1 moreinfo
> 
> On Fri, 08 Mar 2024 09:54:07 + Julian Gilbey  wrote:
> > Package: dot2tex
> > Version: 2.11.3-4
> > Severity: normal
> > 
> > While installing this version on a testing system, lots of warning
> > messages were given; the relevant strings should be marked as raw.
> > [...]
> 
> Thanks for the report!
> 
> I'm not able to reproduce these warnings.  What did you run to get them?

I was building or testing a package using sbuild or autopkgtest using
lxc, I don't remember which.  One of the dependencies was dot2tex, so
it was being installed on a clean chroot (or equivalent).  The
warnings appeared during the dpkg installation of the package
(probably during the configure step).

But either way, all of these are, indeed, syntax errors and need to be
corrected.  (It turns out, just looking at the first example on line
1236, that they cannot all be fixed by turning them into raw strings:
this string has both '\p', which should be '\\p' (with a literal
backslash), and '\n', which presumably is intended as a new line
character.

Best wishes,

   Julian



Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-17 Thread Torrance, Douglas

Control: tags -1 moreinfo

On Fri, 08 Mar 2024 09:54:07 + Julian Gilbey  wrote:

Package: dot2tex
Version: 2.11.3-4
Severity: normal

While installing this version on a testing system, lots of warning
messages were given; the relevant strings should be marked as raw.

/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:900: SyntaxWarning: invalid 
escape sequence '\i'
  variables['<>'] = "\input{gvcols.tex}"
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1236: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psellipse[%s](%sbp,%sbp)(%sbp,%sbp)\n" % (stylestr, smart_float(x), 
smart_float(y),
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1256: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \pspolygon[%s]%s\n" % (stylestr, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1262: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psline%s\n" % "".join(pp)
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1272: SyntaxWarning: invalid 
escape sequence '\p'
  return "  \psbezier{%s}%s\n" % (arrowstyle, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1299: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{linecolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1306: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{fillcolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1313: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{linecolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1322: SyntaxWarning: invalid 
escape sequence '\p'
  return "  \psset{%s}\n" % psstyle
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1393: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psbezier[%s]%s\n" % (stylestr, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1395: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psline[%s]%s%s\n" % (stylestr, pp[0], pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1589: SyntaxWarning: invalid 
escape sequence '\p'
  dashed='\pgfsetdash{{3pt}{3pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1590: SyntaxWarning: invalid 
escape sequence '\p'
  dotted='\pgfsetdash{{\pgflinewidth}{2pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1591: SyntaxWarning: invalid 
escape sequence '\p'
  bold='\pgfsetlinewidth{1.2pt}')
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1639: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{newcol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1641: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetcolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1649: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{strokecol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1651: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetstrokecolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1661: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{fillcol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1663: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetfillcolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1707: SyntaxWarning: invalid 
escape sequence '\%'
  s += "  \%s%s (%sbp,%sbp) ellipse (%sbp and %sbp);\n" % (cmd, stylestr, 
smart_float(x), smart_float(y),
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1723: SyntaxWarning: invalid 
escape sequence '\%'
  s = "  \%s%s %s -- cycle;\n" % (cmd, stylestr, " -- ".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1730: SyntaxWarning: invalid 
escape sequence '\d'
  return "  \draw%s %s;\n" % (stylestr, " -- ".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1753: SyntaxWarning: invalid 
escape sequence '\d'
  s = "  \draw (%sbp,%sbp) node%s {%s};\n" % (smart_float(x), smart_float(y), 
lblstyle, text)
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1765: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw%s %s .. %s;\n" % (stylestr, " .. ".join(pstrs), pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1857: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw [%s] %s to[%s]%s %s;\n" % (stylestr, src,
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1860: SyntaxWarning: invalid 
escape sequence '\d'


Thanks for the report!

I'm not able to reproduce these warnings.  What did you run to get them?


signature.asc
Description: PGP signature


Bug#1065655: dot2tex: SyntaxWarning: invalid escape sequences

2024-03-08 Thread Julian Gilbey
Package: dot2tex
Version: 2.11.3-4
Severity: normal

While installing this version on a testing system, lots of warning
messages were given; the relevant strings should be marked as raw.

/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:900: SyntaxWarning: invalid 
escape sequence '\i'
  variables['<>'] = "\input{gvcols.tex}"
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1236: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psellipse[%s](%sbp,%sbp)(%sbp,%sbp)\n" % (stylestr, smart_float(x), 
smart_float(y),
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1256: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \pspolygon[%s]%s\n" % (stylestr, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1262: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psline%s\n" % "".join(pp)
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1272: SyntaxWarning: invalid 
escape sequence '\p'
  return "  \psbezier{%s}%s\n" % (arrowstyle, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1299: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{linecolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1306: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{fillcolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1313: SyntaxWarning: invalid 
escape sequence '\p'
  s = "  \psset{linecolor=%s}\n" % color
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1322: SyntaxWarning: invalid 
escape sequence '\p'
  return "  \psset{%s}\n" % psstyle
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1393: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psbezier[%s]%s\n" % (stylestr, "".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1395: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \psline[%s]%s%s\n" % (stylestr, pp[0], pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1589: SyntaxWarning: invalid 
escape sequence '\p'
  dashed='\pgfsetdash{{3pt}{3pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1590: SyntaxWarning: invalid 
escape sequence '\p'
  dotted='\pgfsetdash{{\pgflinewidth}{2pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1591: SyntaxWarning: invalid 
escape sequence '\p'
  bold='\pgfsetlinewidth{1.2pt}')
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1639: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{newcol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1641: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetcolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1649: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{strokecol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1651: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetstrokecolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1661: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \definecolor{fillcol}%s;\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1663: SyntaxWarning: invalid 
escape sequence '\p'
  s += "  \pgfsetfillcolor{%s}\n" % ccolor
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1707: SyntaxWarning: invalid 
escape sequence '\%'
  s += "  \%s%s (%sbp,%sbp) ellipse (%sbp and %sbp);\n" % (cmd, stylestr, 
smart_float(x), smart_float(y),
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1723: SyntaxWarning: invalid 
escape sequence '\%'
  s = "  \%s%s %s -- cycle;\n" % (cmd, stylestr, " -- ".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1730: SyntaxWarning: invalid 
escape sequence '\d'
  return "  \draw%s %s;\n" % (stylestr, " -- ".join(pp))
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1753: SyntaxWarning: invalid 
escape sequence '\d'
  s = "  \draw (%sbp,%sbp) node%s {%s};\n" % (smart_float(x), smart_float(y), 
lblstyle, text)
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1765: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw%s %s .. %s;\n" % (stylestr, " .. ".join(pstrs), pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1857: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw [%s] %s to[%s]%s %s;\n" % (stylestr, src,
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1860: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw [%s] %s ..%s %s;\n" % (stylestr, " .. ".join(pstrs), extra, 
pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:1862: SyntaxWarning: invalid 
escape sequence '\d'
  s += "  \draw [%s] %s --%s %s;\n" % (stylestr, pp[0], extra, pp[-1])
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:2110: SyntaxWarning: invalid 
escape sequence '\p'
  dashed='\pgfsetdash{{3pt}{3pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:2111: SyntaxWarning: invalid 
escape sequence '\p'
  dotted='\pgfsetdash{{\pgflinewidth}{2pt}}{0pt}',
/usr/lib/python3/dist-packages/dot2tex/dot2tex.py:2112: SyntaxWarning: invalid 
escape sequence '\p'
  bold='\pgfsetlinewidth{