(self)
| 568 | |
| 569 | @unittest.expectedFailureIf(sys.platform == "linux", "TODO: RUSTPYTHON") |
| 570 | def test_non_ascii(self): |
| 571 | # Mac OS X denies the creation of a file with an invalid UTF-8 name. |
| 572 | # Windows allows creating a name with an arbitrary bytes name, but |
| 573 | # Python cannot a undecodable bytes argument to a subprocess. |
| 574 | # WASI does not permit invalid UTF-8 names. |
| 575 | if (os_helper.TESTFN_UNDECODABLE |
| 576 | and sys.platform not in ('win32', 'darwin', 'emscripten', 'wasi')): |
| 577 | name = os.fsdecode(os_helper.TESTFN_UNDECODABLE) |
| 578 | elif os_helper.TESTFN_NONASCII: |
| 579 | name = os_helper.TESTFN_NONASCII |
| 580 | else: |
| 581 | self.skipTest("need os_helper.TESTFN_NONASCII") |
| 582 | |
| 583 | # Issue #16218 |
| 584 | source = 'print(ascii(__file__))\n' |
| 585 | script_name = _make_test_script(os.getcwd(), name, source) |
| 586 | self.addCleanup(os_helper.unlink, script_name) |
| 587 | rc, stdout, stderr = assert_python_ok(script_name) |
| 588 | self.assertEqual( |
| 589 | ascii(script_name), |
| 590 | stdout.rstrip().decode('ascii'), |
| 591 | 'stdout=%r stderr=%r' % (stdout, stderr)) |
| 592 | self.assertEqual(0, rc) |
| 593 | |
| 594 | def test_issue20500_exit_with_exception_value(self): |
| 595 | script = textwrap.dedent("""\ |
nothing calls this directly
no test coverage detected