(self)
| 103 | |
| 104 | @unittest.expectedFailureIf(MS_WINDOWS, "TODO: RUSTPYTHON") |
| 105 | def test_filesystemencoding(self): |
| 106 | code = textwrap.dedent(''' |
| 107 | import sys |
| 108 | print("{}/{}".format(sys.getfilesystemencoding(), |
| 109 | sys.getfilesystemencodeerrors())) |
| 110 | ''') |
| 111 | |
| 112 | if MS_WINDOWS: |
| 113 | expected = 'utf-8/surrogatepass' |
| 114 | else: |
| 115 | expected = 'utf-8/surrogateescape' |
| 116 | |
| 117 | out = self.get_output('-X', 'utf8', '-c', code) |
| 118 | self.assertEqual(out, expected) |
| 119 | |
| 120 | if MS_WINDOWS: |
| 121 | # PYTHONLEGACYWINDOWSFSENCODING disables the UTF-8 mode |
| 122 | # and has the priority over -X utf8 and PYTHONUTF8 |
| 123 | out = self.get_output('-X', 'utf8', '-c', code, |
| 124 | PYTHONUTF8='strict', |
| 125 | PYTHONLEGACYWINDOWSFSENCODING='1') |
| 126 | self.assertEqual(out, 'mbcs/replace') |
| 127 | |
| 128 | # TODO: RUSTPYTHON |
| 129 | @unittest.expectedFailure |
nothing calls this directly
no test coverage detected