aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_string_literals.py
Commit message (Collapse)AuthorAge
* gh-131649: fix test_string_literals SyntaxWarning (#131650)Thomas Grainger2025-03-26
|
* gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer ↵Pablo Galindo Salgado2025-02-13
| | | | (#116049)
* gh-128016: Improved invalid escape sequence warning message (#128020)Umar Butler2025-01-15
|
* Fix typos (#123775)algonell2024-09-09
|
* gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is ↵Pablo Galindo Salgado2023-10-27
| | | | encouintered (#111381)
* gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)Victor Stinner2022-11-03
| | | | | | | | | | | | | | | | | | | | | | A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence), use raw strings for regular expression: re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. Octal escapes with value larger than 0o377 (ex: "\477"), deprecated in Python 3.11, now produce a SyntaxWarning, instead of DeprecationWarning. In a future Python version they will be eventually a SyntaxError. codecs.escape_decode() and codecs.unicode_escape_decode() are left unchanged: they still emit DeprecationWarning. * The parser only emits SyntaxWarning for Python 3.12 (feature version), and still emits DeprecationWarning on older Python versions. * Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and wasm_build.py.
* gh-94808: Coverage: Test uppercase string literal prefixes (GH-95925)Michael Droettboom2022-09-24
|
* gh-81548: Deprecate octal escape sequences with value larger than 0o377 ↵Serhiy Storchaka2022-04-30
| | | | (GH-91668)
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-11
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)Lysandros Nikolaou2020-05-07
| | | | | | | When parsing a string with an invalid escape, the old parser used to point to the beginning of the invalid string. This commit changes the new parser to match that behaviour, since it's currently pointing to the end of the string (or to be more precise, to the beginning of the next token).
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-30
|
* bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)Victor Stinner2020-04-23
| | | | | | | | | | | * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-22
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)Gregory P. Smith2019-08-10
| | | | | | | | | | | | | | | | | | DeprecationWarning will continue to be emitted for invalid escape sequences in string and bytes literals just as it did in 3.7. SyntaxWarning may be emitted in the future. But per mailing list discussion, we don't yet know when because we haven't settled on how to do so in a non-disruptive manner. (Applies 4c5b6bac2408f879231c7cd38d67657dd4804e7c to the master branch). (This is https://github.com/python/cpython/pull/15142 for master/3.9) https://bugs.python.org/issue32912 Automerge-Triggered-By: @gpshead
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-01
|
* bpo-35798: Add test.support.check_syntax_warning(). (#11895)Serhiy Storchaka2019-02-19
| | | | | | | It checks that a SyntaxWarning is raised when compile specified statement, that it is raised only once, that it is converted to a SyntaxError when raised as exception, and that both warning and exception objects have corresponding attributes.
* bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)Anthony Sottile2019-01-13
|
* bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652)Serhiy Storchaka2018-10-19
| | | | for invalid escape sequences in string and bytes literals.
* Fix warn_invalid_escape_sequence()Victor Stinner2016-11-15
| | | | | | | | Issue #28691: Fix warn_invalid_escape_sequence(): handle correctly DeprecationWarning raised as an exception. First clear the current exception to replace the DeprecationWarning exception with a SyntaxError exception. Unit test written by Serhiy Storchaka.
* Issue 28128: Print out better error/warning messages for invalid string ↵Eric V. Smith2016-10-31
| | | | escapes. Backport to 3.6.
* Rename test_strlit -> test_string_literalsZachary Ware2016-09-09