Skip to content

Commit c045593

Browse files
authored
impl more nt (#6984)
* mpl new features * windows encodings * impl nt functions * revert * codecs * fix codecs
1 parent 9f0cd32 commit c045593

File tree

17 files changed

+902
-336
lines changed

17 files changed

+902
-336
lines changed

Lib/test/test_bufio.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ def test_nullpat(self):
6565
class CBufferSizeTest(BufferSizeTest, unittest.TestCase):
6666
open = io.open
6767

68-
# TODO: RUSTPYTHON
69-
import sys
70-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, can't cleanup temporary file on Windows")
7168
class PyBufferSizeTest(BufferSizeTest, unittest.TestCase):
7269
open = staticmethod(pyio.open)
7370

Lib/test/test_cmd_line_script.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ def test_syntaxerror_unindented_caret_position(self):
620620
# Confirm that the caret is located under the '=' sign
621621
self.assertIn("\n ^^^^^\n", text)
622622

623-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
624623
def test_syntaxerror_indented_caret_position(self):
625624
script = textwrap.dedent("""\
626625
if True:

Lib/test/test_codecs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,7 +3451,6 @@ def decode_to_bytes(*args, **kwds):
34513451
class CodePageTest(unittest.TestCase):
34523452
CP_UTF8 = 65001
34533453

3454-
@unittest.expectedFailure # TODO: RUSTPYTHON
34553454
def test_invalid_code_page(self):
34563455
self.assertRaises(ValueError, codecs.code_page_encode, -1, 'a')
34573456
self.assertRaises(ValueError, codecs.code_page_decode, -1, b'a')
@@ -3670,7 +3669,6 @@ def test_multibyte_encoding(self):
36703669
('[\U0010ffff\uDC80]', 'replace', b'[\xf4\x8f\xbf\xbf?]'),
36713670
))
36723671

3673-
@unittest.expectedFailure # TODO: RUSTPYTHON
36743672
def test_code_page_decode_flags(self):
36753673
# Issue #36312: For some code pages (e.g. UTF-7) flags for
36763674
# MultiByteToWideChar() must be set to 0.

Lib/test/test_compileall.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ def test_recursion_limit(self):
722722
self.assertCompiled(spamfn)
723723
self.assertCompiled(eggfn)
724724

725-
@unittest.skipIf(sys.platform == 'win32', 'TODO: RUSTPYTHON hangs')
726725
@os_helper.skip_unless_symlink
727726
def test_symlink_loop(self):
728727
# Currently, compileall ignores symlinks to directories.

Lib/test/test_concurrent_futures/test_wait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def test_first_completed_some_already_completed(self): super().test_first_comple
209209
def test_first_exception(self): super().test_first_exception() # TODO: RUSTPYTHON
210210
@unittest.skipIf(sys.platform == 'linux', "TODO: RUSTPYTHON flaky")
211211
def test_first_exception_one_already_failed(self): super().test_first_exception_one_already_failed() # TODO: RUSTPYTHON
212-
@unittest.skipIf(sys.platform == 'linux', "TODO: RUSTPYTHON Fatal Python error: Segmentation fault")
212+
@unittest.skipIf(sys.platform != 'win32', "TODO: RUSTPYTHON flaky")
213213
def test_first_exception_some_already_complete(self): super().test_first_exception_some_already_complete() # TODO: RUSTPYTHON
214214
@unittest.skipIf(sys.platform == 'linux', "TODO: RUSTPYTHON Fatal Python error: Segmentation fault")
215215
def test_timeout(self): super().test_timeout() # TODO: RUSTPYTHON

Lib/test/test_exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ def __init__(self, fancy_arg):
747747
x = DerivedException(fancy_arg=42)
748748
self.assertEqual(x.fancy_arg, 42)
749749

750-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; Windows")
751750
@no_tracing
752751
def testInfiniteRecursion(self):
753752
def f():
@@ -1415,7 +1414,6 @@ def __str__(self):
14151414
exc = UnicodeTranslateError("x", 0, 1, Evil("reason"))
14161415
self.assertRaises(TypeError, str, exc)
14171416

1418-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; Windows")
14191417
@no_tracing
14201418
def test_badisinstance(self):
14211419
# Bug #2542: if issubclass(e, MyException) raises an exception,
@@ -1700,7 +1698,6 @@ def inner():
17001698
gc_collect() # For PyPy or other GCs.
17011699
self.assertEqual(wr(), None)
17021700

1703-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; Windows")
17041701
@no_tracing
17051702
def test_recursion_error_cleanup(self):
17061703
# Same test as above, but with "recursion exceeded" errors
@@ -1722,7 +1719,6 @@ def inner():
17221719
gc_collect() # For PyPy or other GCs.
17231720
self.assertEqual(wr(), None)
17241721

1725-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; error specific to cpython")
17261722
def test_errno_ENOTDIR(self):
17271723
# Issue #12802: "not a directory" errors are ENOTDIR even on Windows
17281724
with self.assertRaises(OSError) as cm:

Lib/test/test_os.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,7 +3630,6 @@ def test_spawnl(self):
36303630
exitcode = os.spawnl(os.P_WAIT, program, *args)
36313631
self.assertEqual(exitcode, self.exitcode)
36323632

3633-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; fix spawnve on Windows")
36343633
@requires_os_func('spawnle')
36353634
def test_spawnle(self):
36363635
program, args = self.create_args(with_env=True)
@@ -3659,7 +3658,6 @@ def test_spawnv(self):
36593658
exitcode = os.spawnv(os.P_WAIT, FakePath(program), args)
36603659
self.assertEqual(exitcode, self.exitcode)
36613660

3662-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; fix spawnve on Windows")
36633661
@requires_os_func('spawnve')
36643662
def test_spawnve(self):
36653663
program, args = self.create_args(with_env=True)
@@ -3767,7 +3765,6 @@ def _test_invalid_env(self, spawn):
37673765
exitcode = spawn(os.P_WAIT, program, args, newenv)
37683766
self.assertEqual(exitcode, 0)
37693767

3770-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; fix spawnve on Windows")
37713768
@requires_os_func('spawnve')
37723769
def test_spawnve_invalid_env(self):
37733770
self._test_invalid_env(os.spawnve)

Lib/test/test_posix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,6 @@ def test_chmod_file_symlink(self):
10741074
self.check_chmod_link(posix.chmod, target, link)
10751075
self.check_chmod_link(posix.chmod, target, link, follow_symlinks=True)
10761076

1077-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON; flaky")
10781077
@os_helper.skip_unless_symlink
10791078
def test_chmod_dir_symlink(self):
10801079
target = self.tempdir()

Lib/test/test_runpy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ def test_basic_script_no_suffix(self):
680680
self._check_script(script_name, "<run_path>", script_name,
681681
script_name, expect_spec=False)
682682

683-
@unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON; weird panic in lz4-flex")
684683
def test_script_compiled(self):
685684
with temp_dir() as script_dir:
686685
mod_name = 'script'

Lib/test/test_script_helper.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def tearDown(self):
8282
# Reset the private cached state.
8383
script_helper.__dict__['__cached_interp_requires_environment'] = None
8484

85-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, ValueError: illegal environment variable name")
8685
@mock.patch('subprocess.check_call')
8786
def test_interpreter_requires_environment_true(self, mock_check_call):
8887
with mock.patch.dict(os.environ):
@@ -92,7 +91,6 @@ def test_interpreter_requires_environment_true(self, mock_check_call):
9291
self.assertTrue(script_helper.interpreter_requires_environment())
9392
self.assertEqual(1, mock_check_call.call_count)
9493

95-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, ValueError: illegal environment variable name")
9694
@mock.patch('subprocess.check_call')
9795
def test_interpreter_requires_environment_false(self, mock_check_call):
9896
with mock.patch.dict(os.environ):
@@ -102,7 +100,6 @@ def test_interpreter_requires_environment_false(self, mock_check_call):
102100
self.assertFalse(script_helper.interpreter_requires_environment())
103101
self.assertEqual(1, mock_check_call.call_count)
104102

105-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, ValueError: illegal environment variable name")
106103
@mock.patch('subprocess.check_call')
107104
def test_interpreter_requires_environment_details(self, mock_check_call):
108105
with mock.patch.dict(os.environ):
@@ -115,7 +112,6 @@ def test_interpreter_requires_environment_details(self, mock_check_call):
115112
self.assertEqual(sys.executable, check_call_command[0])
116113
self.assertIn('-E', check_call_command)
117114

118-
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, ValueError: illegal environment variable name")
119115
@mock.patch('subprocess.check_call')
120116
def test_interpreter_requires_environment_with_pythonhome(self, mock_check_call):
121117
with mock.patch.dict(os.environ):

0 commit comments

Comments
 (0)