@@ -842,16 +842,18 @@ def test_fromwidechar(self):
842842 if SIZEOF_WCHAR_T == 2 :
843843 self .assertEqual (fromwidechar ('a\U0001f600 ' .encode (encoding ), 2 ), 'a\ud83d ' )
844844
845- self .assertRaises (MemoryError , fromwidechar , b'' , PY_SSIZE_T_MAX )
846845 self .assertRaises (SystemError , fromwidechar , b'\0 ' * SIZEOF_WCHAR_T , - 2 )
847- self .assertRaises (SystemError , fromwidechar , b'\0 ' * SIZEOF_WCHAR_T , PY_SSIZE_T_MIN )
848846 self .assertEqual (fromwidechar (NULL , 0 ), '' )
849847 self .assertRaises (SystemError , fromwidechar , NULL , 1 )
850848 self .assertRaises (SystemError , fromwidechar , NULL , PY_SSIZE_T_MAX )
851849 self .assertRaises (SystemError , fromwidechar , NULL , - 1 )
852850 self .assertRaises (SystemError , fromwidechar , NULL , - 2 )
853851 self .assertRaises (SystemError , fromwidechar , NULL , PY_SSIZE_T_MIN )
854852
853+ # The following tests are skipped since they rely on undefined behavior
854+ #self.assertRaises(MemoryError, fromwidechar, b'', PY_SSIZE_T_MAX)
855+ #self.assertRaises(SystemError, fromwidechar, b'\0'*SIZEOF_WCHAR_T, PY_SSIZE_T_MIN)
856+
855857 @support .cpython_only
856858 @unittest .skipIf (_testlimitedcapi is None , 'need _testlimitedcapi module' )
857859 def test_aswidechar (self ):
0 commit comments