Skip to content

ctypes issues #457

Open
Open
@slide

Description

@slide
  • _as_parameter_ not implemented for CFuncPtr in ctypes (see as_parameter not implemented for CFuncPtr in ctypes)
  • Debug issue with ctypes\test\test_frombuffer.py#test_abstract
  • Marshaling of strings when no argtypes is provided is incorrect. This is seen in ctypes\test\test_functions.py test_stringresult.
  • test_memfunctions.py is not working correctly - test_memmove and test_string_at are not working
  • test_memmove and test_string_at are not working
  • Issue in ctypes\test\test_strings.py
def test_c_buffer_deprecated(self):
        # Compatibility with 2.x
        with test_support.check_py3k_warnings():
            self.test_c_buffer_value(buffer)
            self.test_c_buffer_raw(buffer)
======================================================================
FAIL: test_c_buffer_deprecated (__main__.StringArrayTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\test\support\__init__.py", line 944, in _filterwarnings
    yield WarningsRecorder(w)
AssertionError: TypeError not raised
  • Issue in ctypes\test\test_win32.py
def test_struct_by_value(self):
        class POINT(Structure):
            _fields_ = [("x", c_long),
                        ("y", c_long)]

        class RECT(Structure):
            _fields_ = [("left", c_long),
                        ("top", c_long),
                        ("right", c_long),
                        ("bottom", c_long)]

        dll = CDLL(_ctypes_test.__file__)

        pt = POINT(15, 25)
        left = c_long.in_dll(dll, 'left')
        top = c_long.in_dll(dll, 'top')
        right = c_long.in_dll(dll, 'right')
        bottom = c_long.in_dll(dll, 'bottom')
        rect = RECT(left, top, right, bottom)
        PointInRect = dll.PointInRect
        PointInRect.argtypes = [POINTER(RECT), POINT]
        self.assertEqual(1, PointInRect(byref(rect), pt))

        ReturnRect = dll.ReturnRect
        ReturnRect.argtypes = [c_int, RECT, POINTER(RECT), POINT, RECT,
                               POINTER(RECT), POINT, RECT]
        ReturnRect.restype = RECT
        for i in range(4):
            ret = ReturnRect(i, rect, pointer(rect), pt, rect,
                         byref(rect), pt, rect)
            # the c function will check and modify ret if something is
            # passed in improperly
            self.assertEqual(ret.left, left.value)
            self.assertEqual(ret.right, right.value)
            self.assertEqual(ret.top, top.value)
            self.assertEqual(ret.bottom, bottom.value)

        # to not leak references, we must clean _pointer_type_cache
        from ctypes import _pointer_type_cache
        del _pointer_type_cache[RECT]
======================================================================
FAIL: test_struct_by_value (__main__.Structures)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_win32.py", line 114, in test_struct_by_value
    self.assertEqual(ret.left, left.value)
AssertionError: 100 != 10
  • ctypes.set_last_error is not per-thread
    From ctypes\test\test_errno.py
def test_GetLastError(self):
    def _worker():
        set_last_error(0)

        dll = WinDLL("kernel32", use_last_error=False)
        GetModuleHandle = dll.GetModuleHandleW
        GetModuleHandle.argtypes = [c_wchar_p]
        GetModuleHandle("bar")

        self.assertEqual(get_last_error(), 0)

        t = threading.Thread(target=_worker)
        t.start()
        t.join()

        self.assertEqual(get_last_error(), 32)

The threaded portion is not working because the last error is not stored per thread.

  • ctypes\test\test_parameters.py is failing
F.FFFFFsE..
======================================================================
ERROR: test_noctypes_argtype (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 158, in test_noctypes_argtype
    self.assertEqual(func(None), None)
NotImplementedError: The method or operation is not implemented.

======================================================================
FAIL: test_abstract (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 182, in test_abstract
    self.assertRaises(TypeError, Array.from_param, 42)
AssertionError: TypeError not raised

======================================================================
FAIL: test_byref_pointer (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 112, in test_byref_pointer
    self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22)))
AssertionError: TypeError not raised

======================================================================
FAIL: test_byref_pointerpointer (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 124, in test_byref_pointerpointer
    self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_short(22))))
AssertionError: TypeError not raised

======================================================================
FAIL: test_cstrings (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 59, in test_cstrings
    self.assertIs(c_char_p.from_param(s)._obj, s)
AssertionError: c_char_p('123') is not '123'

======================================================================
FAIL: test_cw_strings (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 82, in test_cw_strings
    self.assertRaises(UnicodeDecodeError, c_wchar_p.from_param, "123\377")
AssertionError: UnicodeDecodeError not raised

======================================================================
FAIL: test_int_pointers (__main__.SimpleTypesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_parameters.py", line 97, in test_int_pointers
    self.assertEqual(LPINT.from_param(None), None)
AssertionError: 0 != None

----------------------------------------------------------------------
Ran 11 tests in 0.318s

FAILED (failures=6, errors=1, skipped=1)
  • ctypes\test\test_pep3118.py is failing
.<class 'unknown.c_double_Array_4'>
F
======================================================================
FAIL: test_native_types (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pep3118.py", line 27, in test_native_types
    self.assertEqual(normalize(v.format), normalize(fmt))
AssertionError: '(4)<d' != '<d'
- (4)<d
+ <d


----------------------------------------------------------------------
Ran 2 tests in 0.378s

FAILED (failures=1)
  • ctypes\test\test_pickling.py is failing
EEEEEEEEEFFE
======================================================================
ERROR: test_simple (__main__.PickleTest_0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 29, in test_simple
    dst = self.loads(self.dumps(src))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: _SimpleCData() takes at least 2147483647 arguments (1 given)

======================================================================
ERROR: test_struct (__main__.PickleTest_0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 41, in test_struct
    y = self.loads(self.dumps(x))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: Structure() takes at least 2147483647 arguments (0 given)

======================================================================
ERROR: test_unpickable (__main__.PickleTest_0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 55, in test_unpickable
    self.assertRaises(ValueError, lambda: self.dumps(Y()))
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\unittest\case.py", line 479, in assertRaises
    callableObj(*args, **kwargs)
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 55, in <lambda$71>
    self.assertRaises(ValueError, lambda: self.dumps(Y()))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: Structure() takes at least 2147483647 arguments (0 given)

======================================================================
ERROR: test_wchar (__main__.PickleTest_0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 70, in test_wchar
    self.dumps(c_char(b"x"))
TypeError: one character string expected

======================================================================
ERROR: test_simple (__main__.PickleTest_1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 29, in test_simple
    dst = self.loads(self.dumps(src))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: _SimpleCData() takes at least 2147483647 arguments (1 given)

======================================================================
ERROR: test_struct (__main__.PickleTest_1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 41, in test_struct
    y = self.loads(self.dumps(x))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: Structure() takes at least 2147483647 arguments (0 given)

======================================================================
ERROR: test_unpickable (__main__.PickleTest_1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 55, in test_unpickable
    self.assertRaises(ValueError, lambda: self.dumps(Y()))
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\unittest\case.py", line 479, in assertRaises
    callableObj(*args, **kwargs)
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 55, in <lambda$71>
    self.assertRaises(ValueError, lambda: self.dumps(Y()))
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 19, in dumps
    return pickle.dumps(item, self.proto)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 1380, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Users\acearl\Code\_ipy\ironpython2\Src\StdLib\Lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
TypeError: Structure() takes at least 2147483647 arguments (0 given)

======================================================================
ERROR: test_wchar (__main__.PickleTest_1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 70, in test_wchar
    self.dumps(c_char(b"x"))
TypeError: one character string expected

======================================================================
ERROR: test_simple (__main__.PickleTest_2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 31, in test_simple
    self.assertEqual(memoryview(src).tobytes(),
SystemError: Object reference not set to an instance of an object.

======================================================================
ERROR: test_wchar (__main__.PickleTest_2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 70, in test_wchar
    self.dumps(c_char(b"x"))
TypeError: one character string expected

======================================================================
FAIL: test_struct (__main__.PickleTest_2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 49, in test_struct
    self.assertEqual(memoryview(y).tobytes(),
AssertionError: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != b'*\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

======================================================================
FAIL: test_unpickable (__main__.PickleTest_2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_pickling.py", line 55, in test_unpickable
    self.assertRaises(ValueError, lambda: self.dumps(Y()))
AssertionError: ValueError not raised

----------------------------------------------------------------------
Ran 12 tests in 0.600s

FAILED (failures=2, errors=10)
  • ctypes\test\test_prototypes.py is failing
.F
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.Win32.Win32Native.WideCharToMultiByte(UInt32 cp, UInt32 flags, Char* pwzSource, Int32 cchSource, Byte* pbDestBuffer, Int32 cbDestBuffer, IntPtr null1, IntPtr null2)
   at System.String.ConvertToAnsi(Byte* pbNativeBuffer, Int32 cbNativeBuffer, Boolean fBestFit, Boolean fThrowOnUnmappableChar)
   at System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(String s)
   at InteropInvoker(IntPtr , Object , Object[] )
   at CallSite.Target(Closure , CallSite , Object , Object )
   at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 163
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 267
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 97
   at IronPython.Runtime.Method.MethodBinding.SelfTarget(CallSite site, CodeContext context, Object target) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 130
   at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 163
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 130
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 760
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 241
   at Microsoft.Scripting.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 238
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 213
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 161
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 267
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 241
   at System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`8.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 832
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 241
   at Microsoft.Scripting.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 238
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 213
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 161
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 267
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\PythonCallTargets.cs:line 52
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 241
   at System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 238
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\DynamicInstructions.Generated.cs:line 213
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\PythonCallTargets.cs:line 52
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.Generated.cs:line 784
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 202
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 161
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at CallSite.Target(Closure , CallSite , CodeContext , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 267
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 130
   at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 161
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 267
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 97
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at IronPython.Runtime.Method.MethodBinding.SelfTarget(CallSite site, CodeContext context, Object target) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Method.Generated.cs:line 130
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 246
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run12[T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 517
   at IronPython.Compiler.PythonCallTargets.OriginalCallTarget11(PythonFunction function, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\PythonCallTargets.cs:line 92
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Scripting.Interpreter.MethodInfoCallInstruction.InvokeWorker(Object[] args) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.cs:line 262
   at Microsoft.Scripting.Interpreter.MethodInfoCallInstruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Instructions\CallInstruction.cs:line 279
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 165
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite.CallTarget(CallSite site, CodeContext context, Object inst) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Types\PythonType.Generated.cs:line 836
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(CallSite site, CodeContext context, Object type) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Runtime\Types\PythonType.Generated.cs:line 267
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 246
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\Interpreter.cs:line 105
   at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Interpreter\LightLambda.Generated.cs:line 66
   at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 75
   at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Hosting\PythonCommandLine.cs:line 552
   at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Hosting\PythonCommandLine.cs:line 537
   at Microsoft.Scripting.Hosting.Shell.CommandLine.Run() in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Hosting\Shell\CommandLine.cs:line 142
   at IronPython.Hosting.PythonCommandLine.Run() in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPython\Hosting\PythonCommandLine.cs:line 134
   at Microsoft.Scripting.Hosting.Shell.CommandLine.Run(ScriptEngine engine, IConsole console, ConsoleOptions options) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Hosting\Shell\CommandLine.cs:line 110
   at Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Hosting\Shell\ConsoleHost.cs:line 397
   at Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Hosting\Shell\ConsoleHost.cs:line 332
   at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) in C:\Users\USER\Code\_ipy\ironpython2\Src\DLR\Src\Microsoft.Dynamic\Hosting\Shell\ConsoleHost.cs:line 208
   at PythonConsoleHost.Main(String[] args) in C:\Users\USER\Code\_ipy\ironpython2\Src\IronPythonConsole\Console.cs:line 103
  • ctypes\test\test_unicode.py is failing
FFFF.F.FF.
======================================================================
FAIL: test_ascii_ignore (__main__.StringTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 108, in test_ascii_ignore
    self.assertEqual(func(u"äöüß"), "")
AssertionError: u'\xe4\xf6\xfc\xdf' != ''
- äöüß
+


======================================================================
FAIL: test_ascii_replace (__main__.StringTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 115, in test_ascii_replace
    self.assertEqual(func(u"äöüß"), "????")
AssertionError: u'\xe4\xf6\xfc\xdf' != '????'
- äöüß
+ ????


======================================================================
FAIL: test_ascii_strict (__main__.StringTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 28, in test_ascii_strict
    self.assertRaises(ctypes.ArgumentError, wcslen, "abä")
AssertionError: ArgumentError not raised

======================================================================
FAIL: test_buffers (__main__.StringTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 124, in test_buffers
    self.assertEqual(buf[:], "ab???\0")
AssertionError: u'ab\xe4\xf6\xfc\x00' != 'ab???\x00'
- abäöü
+ ab???


======================================================================
FAIL: test_ascii_ignore (__main__.UnicodeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 45, in test_ascii_ignore
    self.assertEqual(wcslen("äöüß"), 0)
AssertionError: 4 != 0

======================================================================
FAIL: test_ascii_strict (__main__.UnicodeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 28, in test_ascii_strict
    self.assertRaises(ctypes.ArgumentError, wcslen, "abä")
AssertionError: ArgumentError not raised

======================================================================
FAIL: test_buffers (__main__.UnicodeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_unicode.py", line 62, in test_buffers
    self.assertEqual(buf[:], u"ab\uFFFD\uFFFD\uFFFD\0")
AssertionError: u'ab\xe4\xf6\xfc\x00' != u'ab\ufffd\ufffd\ufffd\x00'
- abäöü
+ ab???


----------------------------------------------------------------------
Ran 10 tests in 0.457s

FAILED (failures=7)
  • ctypes long double tests are failing on Linux. .NET is using double type for 'g' type format (long double). Long double on Windows is apparently the same as the double type in .NET, but on Linux, long double is a 128bit floating point type.

  • ctypes implementation does not support gcc packing of bitfields. ctypes\test\test_bitfields.py is failing because with gcc, bitfields are not padded like on Windows with cl. So, type sizes are different on Linux and Windows when dealing with bitfields.

======================================================================
FAIL: test_mixed_1 (__main__.BitFieldTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Src/StdLib/Lib/ctypes/test/test_bitfields.py", line 204, in test_mixed_1
    self.assertEqual(sizeof(X), sizeof(c_int))
AssertionError: 8 != 4

======================================================================
FAIL: test_mixed_4 (__main__.BitFieldTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Src/StdLib/Lib/ctypes/test/test_bitfields.py", line 232, in test_mixed_4
    self.assertEqual(sizeof(X), sizeof(c_int) * 2)
AssertionError: 16 != 8

  • ctypes/test/test_pointers.py and ctypes/test/test_functions.py fail
======================================================================
FAIL: test_pointers (__main__.AsParamPropertyWrapperTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_as_parameter.py", line 46, in test_pointers
    self.assertEqual(result.contents.value, 42)
AssertionError: 800442112 != 42

======================================================================
FAIL: test_pointers (__main__.AsParamWrapperTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_as_parameter.py", line 46, in test_pointers
    self.assertEqual(result.contents.value, 42)
AssertionError: 1254194384 != 42

======================================================================
FAIL: test_pointers (__main__.BasicWrapTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\Src\StdLib\Lib\ctypes\test\test_as_parameter.py", line 46, in test_pointers
    self.assertEqual(result.contents.value, 42)
AssertionError: 1254210640 != 42
  • ctypes Structure from_buffer needs to have overload that accepts IBufferProtocol
class Little(LittleEndianStructure):
            _fields_ = [("a", c_uint32, 24),
                        ("b", c_uint32, 4),
                        ("c", c_uint32, 4)]
b = bytearray(4)
x = Little.from_buffer(b)
x.a = 0xabcdef
x.b = 1
x.c = 2
self.assertEqual(b, b'\xef\xcd\xab\x21')

We get a TypeError on this right now because we only have a from_buffer implementation that takes an array type. We need to support IBufferProtocol (and check that it is not ReadOnly)

  • test_win32.py is failing, it is only valid on 32-bit. stdcall calling needs to be looked at.
  • ctypes tests need to be debugged on macOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions