[tahoe-lafs-trac-stream] [Tahoe-LAFS] #4158: SyntaxWarning: invalid escape sequence
Tahoe-LAFS
trac at tahoe-lafs.org
Mon Jan 13 21:22:24 UTC 2025
#4158: SyntaxWarning: invalid escape sequence
-------------------------------+-----------------------
Reporter: hacklschorsch | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: unknown | Version: n/a
Resolution: | Keywords:
Launchpad Bug: |
-------------------------------+-----------------------
Comment (by hacklschorsch):
Some context from https://stackoverflow.com/a/77531416/1181063
> Back in Python 3.6, using invalid escape sequences in string literals
was deprecated (bpo-27364). Since then, attempting to use an invalid
escape sequence has emitted a DeprecationWarning. This can often go
unnoticed if you don't run Python with warnings enabled.
DeprecationWarnings are silenced by default.
>
> Python 3.12 upgraded the DeprecationWarning to a SyntaxWarning.
SyntaxWarnings are emitted by the compiler when the code is parsed, not
when it's being run, so they cannot be ignored using a runtime warning
filter. Unlike DeprecationWarnings, SyntaxWarnings are displayed by
default, which is why you're seeing it now. This increase in visibility
was intentional. In a future version of Python, using invalid escape
sequences in string literals is planned to eventually become a hard
SyntaxError.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/4158#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list