mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-67224: Show source lines in tracebacks when using the -c option when running Python (#111200)
This commit is contained in:
parent
3f84a19e62
commit
90a1b2859f
13 changed files with 104 additions and 36 deletions
|
@ -4396,11 +4396,11 @@ class MiscIOTest(unittest.TestCase):
|
|||
''')
|
||||
proc = assert_python_ok('-X', 'warn_default_encoding', '-c', code)
|
||||
warnings = proc.err.splitlines()
|
||||
self.assertEqual(len(warnings), 2)
|
||||
self.assertEqual(len(warnings), 4)
|
||||
self.assertTrue(
|
||||
warnings[0].startswith(b"<string>:5: EncodingWarning: "))
|
||||
self.assertTrue(
|
||||
warnings[1].startswith(b"<string>:8: EncodingWarning: "))
|
||||
warnings[2].startswith(b"<string>:8: EncodingWarning: "))
|
||||
|
||||
def test_text_encoding(self):
|
||||
# PEP 597, bpo-47000. io.text_encoding() returns "locale" or "utf-8"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue