| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| NULL, NULL) < 0) | ||
| { | ||
| if (PyErr_ExceptionMatches(PyExc_DeprecationWarning)) { | ||
| if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { |
There was a problem hiding this comment.
See the comment below.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, the end goal here is to get a SyntaxError, however this is not yet possible as we have to wait for two releases before this can happen, so we can't yet convert it to a SyntaxError. I probably should update that comment, though (I'll do that tomorrow when I get home).
Sorry, something went wrong.
| return NULL; | ||
| if (first_invalid_escape != NULL) { | ||
| if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | ||
| if (PyErr_WarnFormat(PyExc_SyntaxWarning, 1, |
There was a problem hiding this comment.
This is not related to syntax.
Sorry, something went wrong.
There was a problem hiding this comment.
This warning was added back in 3.6 when we started deprecating the invalid escapes. In 3.8, we're upgrading these to SyntaxWarning so that they're no longer silent by default, and it will eventually be a SyntaxError. The end goal here is to raise a SyntaxError for this use, but this will have to wait for two more releases.
Sorry, something went wrong.
There was a problem hiding this comment.
This warning is emitted by the "unicode-escape" codec.
>>> b'\\z'.decode('unicode-escape')
__main__:1: DeprecationWarning: invalid escape sequence '\z'
'\\z'
Sorry, something went wrong.
Sorry, something went wrong.
| return NULL; | ||
| if (first_invalid_escape != NULL) { | ||
| if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | ||
| if (PyErr_WarnFormat(PyExc_SyntaxWarning, 1, |
There was a problem hiding this comment.
This is not related to syntax.
Sorry, something went wrong.
There was a problem hiding this comment.
This warning was added back in 3.6 when we started deprecating the invalid escapes. In 3.8, we're upgrading these to SyntaxWarning so that they're no longer silent by default, and it will eventually be a SyntaxError. The end goal here is to raise a SyntaxError for this use, but this will have to wait for two more releases.
Sorry, something went wrong.
There was a problem hiding this comment.
No, this warning is emitted by codecs.escape_decode() (which is used in pickle).
>>> codecs.escape_decode(b'\\z') __main__:1: DeprecationWarning: invalid escape sequence '\z' (b'\\z', 2)
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
The codecs module shouldn't raise SyntaxWarning or SyntaxError. It should raise DeprecationWarning, which later will be converted to UnicodeDecodeError.
Sorry, something went wrong.
|
I haven't had the time to work on this, sorry! I'll get back to it hopefully sometime soon. |
Sorry, something went wrong.
|
I think this was done with #9652 and the bpo issue is also marked as resolved. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What the title says. Properly tested and ready for 3.8!
https://bugs.python.org/issue32912
:EDIT:
I don't know how to add a NEWS entry, but I have to go for now. I'll look into that tomorrow.