(self)
| 1716 | |
| 1717 | @unittest.skipIf(sys.flags.utf8_mode, "utf-8 mode is enabled") |
| 1718 | def test_open_default_encoding(self): |
| 1719 | with EnvironmentVarGuard() as env: |
| 1720 | # try to get a user preferred encoding different than the current |
| 1721 | # locale encoding to check that open() uses the current locale |
| 1722 | # encoding and not the user preferred encoding |
| 1723 | env.unset('LC_ALL', 'LANG', 'LC_CTYPE') |
| 1724 | |
| 1725 | self.write_testfile() |
| 1726 | current_locale_encoding = locale.getencoding() |
| 1727 | with warnings.catch_warnings(): |
| 1728 | warnings.simplefilter("ignore", EncodingWarning) |
| 1729 | fp = open(TESTFN, 'w') |
| 1730 | with fp: |
| 1731 | self.assertEqual(fp.encoding, current_locale_encoding) |
| 1732 | |
| 1733 | @support.requires_subprocess() |
| 1734 | def test_open_non_inheritable(self): |
nothing calls this directly
no test coverage detected