[issue32912] Raise non-silent warning for invalid escape sequences

2022-01-13 Thread Daniel Carpenter
Daniel Carpenter added the comment: I'm not sure if this is an issue or by design, but this DeprecationWarning behaves differently to other DeprecationWarnings. A normal DeprecationWarning triggered by code in __main__ is printed by default: $ python -c 'import warnings; warnings.warn("test"

[issue32912] Raise non-silent warning for invalid escape sequences

2020-04-21 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-12 Thread Steve Dower
Change by Steve Dower : -- nosy: +steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-10 Thread miss-islington
miss-islington added the comment: New changeset b4be87a04a2a8ccfd2480e19dc527589fce53555 by Miss Islington (bot) (Gregory P. Smith) in branch 'master': bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195) https://github.com/python/cpython/commit/b4be87a04a2a8ccfd2480e19dc52

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: One possibility is to restrict the warning to a backslash followed by an alphabetic character or backslash, and that we define backslash followed by any other printable character as specifically allowed. This would catch the likely sources of errors with

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: I haven't looked, so not that i'm aware of. I suggest filing one for each of those. The warning not pointing to the right line in a multiline literal sounds like a bug to me so that one, if fixed, seems reasonable for 3.8. The release manager gets to de

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Aaron Meurer
Aaron Meurer added the comment: Are there issues tracking the things I mentioned, which should IMO happen before this becomes a hard error (making the warnings reproduce even if the file has already been compiled, and making warning message point to the correct line in multiline strings)? An

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm leaving this open, as we may still want to do it in 3.9+, just in a less disruptive manner. (That, and how, hasn't been decided yet) Follow the thread(s) on python-dev for the latest on that. -- resolution: fixed -> stage: resolved -> status

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you! -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +14927 pull_request: https://github.com/python/cpython/pull/15195 ___ Python tracker ___

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 4c5b6bac2408f879231c7cd38d67657dd4804e7c by Gregory P. Smith (Serhiy Storchaka) in branch '3.8': [3.8] bpo-32912: Revert SyntaxWarning on invalid escape sequences (GH-15142) https://github.com/python/cpython/commit/4c5b6bac2408f879231c7cd38d67

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-09 Thread Sanyam Khurana
Change by Sanyam Khurana : -- nosy: +CuriousLearner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 15142 reverts that change for 3.8. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +14879 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/15142 ___ Python tracker ___

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: Can the pyc compilation step done by our normal package installers be made to treat this warning as an error so that it is forced into the package owners faces instead of overlooked because it was just something on stderr? This syntax warning is absolutely

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-05 Thread Ned Deily
Change by Ned Deily : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-04 Thread Nathaniel Smith
Nathaniel Smith added the comment: I think we haven't *actually* done a proper DeprecationWarning period for this. We tried, but because of the issue with byte-compiling, the warnings were unconditionally suppressed for most users -- even the users who are diligent enough to enable warnings

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Another issue that I've encountered is that ASCII art becomes gets flagged. > Switching to a raw string then kills the unicode escape sequences. If you already use escape sequences in your ASCII art, what is the problem of using them for backslashes? >

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Well paradoxically, the bugs that this prevents are the ones it doesn't warn about. If someone writes '\tan(x)' thinking it is a string representing a LaTeX formula for the tangent of x, they won't realize that they actually created a string with a tab plus "a

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Raymond, are you in agreement that these warnings should > at some point eventually become syntax errors? I used to think so, but after experiencing the incessant warnings, I question the value. In inactive sessions (either with the regular REPL or the

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer
Aaron Meurer added the comment: Raymond, are you in agreement that these warnings should at some point eventually become syntax errors? -- ___ Python tracker ___

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: AFAICT, I'm currently one of the only people in the world using the 3.8 beta for my work on a daily basis. I've encountered these warnings multiple times in multiple contexts. If we think other people won't experience this recurring annoyance, we're in

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm starting to see this error even for plain text strings in existing code: >>> dunder_methods = ''' d[k] d.__getitem__(k) -> value \--> d.__missing__(k) -> value \---> raise KeyError(k) d[k] = v

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The warning in docutils was fixed in https://sourceforge.net/p/docutils/code/8255/ 1.5 months ago. It was an outliner, all other occurrences of \leavevmode were either with the double backslash or in raw string literals. The Bottle code was written 5 year

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think it is poor form to bombard end-users with warnings about things they can't fix. -- ___ Python tracker ___ ___

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's another example from the current build of the docs using Sphinx: (venv) ~/npython/Doc $ make html mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -D latex_elements.papersize= -W

[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: > In other words, it seems to me that getting in the way of > this broken end-user strategy is a *good* thing, since it > warns of possible mistakes. Here's an example from the current version of Bottle (0.12.17): /Users/raymond/Dropbox/Public/sj205/notes

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: The 'filled my terminal with spaces' bug mentioned in msg344764 was independently reported in #37433, with a PR. -- nosy: +terry.reedy ___ Python tracker __

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-15 Thread Mark Dickinson
Mark Dickinson added the comment: [Aaron] > [...] makes it very difficult for library authors to fix this. If you're willing to use 3rd party libraries, then my own experience is that `pycodestyle` or `flake8` make this easy: you just need to run "flake8 --select W605" at the root of your r

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-15 Thread Mark Dickinson
Mark Dickinson added the comment: [Raymond] > Also, it gets in the way of the end-user strategy of "backslash anything that > looks special" That's not a good strategy in the first place, though: adding an extra backslash for something that doesn't need to be escaped isn't benign - it's us

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-14 Thread Aaron Meurer
Aaron Meurer added the comment: I agree. Please someone else do that. I don't know what already has issues and I unfortunately don't have time right now to help out with any of this. I simply mentioned all these things as arguments why Python should not (yet) make these warnings errors, whi

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Aaron, you have reported several different issues in your message: * compiler warnings are emitted only once, therefore it is easy to miss them and hard to reproduce. * warnings for multiline expressions (and multiline string literals in particularly) cou

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In the particular case of pyparsing there was a bug in the docstring. def sub(self, repl): """ Return Regex with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string)

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-05 Thread Aaron Meurer
Aaron Meurer added the comment: I agree with Raymond that third party libraries are not ready for this. My biggest issue is that the way Python warns about this makes it very difficult for library authors to fix this. Most won't even notice. The problem is the warnings are only shown once,

[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm seeing these warnings pop up from time to time with various third party packages (such as pyparsing which is invoked by ensurepip). Am wondering whether this should be deferred for another version or so until be have good confidence that the major thi

[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6543912c90ffa579dc4c01e811f9609cf92197d3 by Serhiy Storchaka in branch 'master': bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652) https://github.com/python/cpython/commit/6543912c90ffa579dc4c01e811f9609cf92197d3 ---

[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since the author of PR 5849 had not the time to work on it, I have created PR 9652 which properly replaces a DeprecationWarning with a SyntaxWarning. It also updates the documentation. -- ___ Python tracker

[issue32912] Raise non-silent warning for invalid escape sequences

2018-10-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +9043 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 5849 changes not only the Python parser, but codecs. It shouldn't. The Python parser and codecs will go different ways. The warning in the Python parser will finally be upgraded to SyntaxError (it is already replaced with SyntaxError if the warning is ra

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-24 Thread Emanuel Barry
Change by Emanuel Barry : -- keywords: +patch pull_requests: +5625 stage: needs patch -> patch review ___ Python tracker ___ ___ Pyth

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for the DeprecationWarning->SyntaxWarning->SyntaxError approach from me (especially as 3.7 will make the existing deprecation warning visible in interactive shells and __main__ modules by default). -- ___ Python t

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ncoghlan, r.david.murray, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing

[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-22 Thread Emanuel Barry
New submission from Emanuel Barry : This is a follow-up to Issue27364. Back in Python 3.6, a silent warning was added for all invalid escape sequences in str and bytes. It was suggested that it would remain a silent warning (which still impacts tests, while not visually annoying the average us