Python warning: lyx_pot.py:607: SyntaxWarning: invalid escape sequence '\w'

Scott Kostyshak skostysh at lyx.org
Sun Jun 9 17:17:55 UTC 2024


On Sat, Jun 08, 2024 at 09:27:19PM GMT, José Matos wrote:
> On Sat, 2024-06-08 at 12:14 -0400, Scott Kostyshak wrote:
> > Another question: from googling it seems that the command
> > 
> >   python -W error foobar.py
> > 
> > would give an error (which hopefully would stop the build).
> 
> 
> According to the man page there is no space in between, it should be -
> Werror or even -We.
> 
> But just like for C++ code I prefer for the warning to be a warning.
> :-)

Fair enough ;)

> > I haven't tested, but would the way to ask our build systems to use
> > the flag be to use the PYTHON environment variable? (./configure --
> > help tells me this is used)?
> 
> Please no, I am still traumatized with our use of python -tt (that by
> the way is a no-op in Python 3). :-)
> 
> Thus I intend to remove -tt from existence in our code (development).

Ah indeed that will be a nice cleanup.

> > I'm pretending that I will add this flag, but I'm secretly hoping you
> > will add it and fix all warnings before I even see them ;)
> > 
> > Scott
> 
> BTW in the case that you have fixed there were several problems, \w is
> just the first of them.
> Actually every use of the backslash in that string was a problem (and
> there are 17 in there).
> 
> And you are right, linters are very good at catching those cases (here
> I get that directly indication both with emacs and kate, using
> plugins).

Good to know! Thanks for your responses.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240609/b9a1e87b/attachment.asc>


More information about the lyx-devel mailing list