Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36085: Enable better DLL resolution on Windows #12302

Merged
merged 30 commits into from
Mar 29, 2019
Merged

Conversation

zooba
Copy link
Member

@zooba zooba commented Mar 13, 2019

Modules/posixmodule.c Outdated Show resolved Hide resolved
*/
hMod = LoadLibraryExW(name, NULL,
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
Copy link
Contributor

@eryksun eryksun Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR as a default in ctypes. It will fail the call as an invalid parameter if name isn't fully qualified. This flag doesn't even allow paths that are explicitly relative to the working directory due to the way path searching works in Windows. For example, ".\spam\eggs.dll" is joined with every directory in the computed DLL search path (e.g. "C:\Windows\System32\.\spam\eggs.dll"). The secure search path never includes the current working directory, so the loader can't assume we want the given path to be resolved relative to the working directory in order to compute the DLL directory. It has to fail the call. (In contrast, with POSIX dlopen "./spam/eggs.so" is only resolved relative to the working directory.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right., I'll remove it again.

Making the second argument consistent with dlopen is a much bigger task that I can't afford to take on right now, so I'm going to leave that open. We can discuss on the bug whether that should block the entire change or not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think something should be done about the relative-path issue? The behavior is documented:

If lpFileName specifies a relative path, the entire relative path is appended to every token in the DLL search path. To load a module from a relative path without searching any other path, use GetFullPathName to get a nonrelative path and call LoadLibraryEx with the nonrelative path.

IMO, this behavior is counter-intuitive and disagrees with POSIX. I'd expect CDLL("spam/eggs.dll") to resolve the path relative to the working directory. I don't think most people would intuit that the system actually searches relative to each directory in the computed DLL search path. This seems to work with the expected behavior when the current directory is in the DLL search path. Albeit, with the default safe order, the working directory is checked after the application, System32, and Windows directories, but a collision with a system DLL is unlikely. On the other hand, with the secure search path, which doesn't include the working directory, scripts will almost definitely fail if they depend on an explicit reference to the working directory (e.g. "./eggs.dll" or "spam/eggs.dll").

If we were Windows only, I'd point people to the documentation and tell them to adjust their expectations appropriately. But we're cross-platform, and the Windows behavior is the odd duck here. Maybe we should call GetFullPathNameW on any path that includes slash or backslash in order to match expected behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, ctypes could fail the call as a ValueError if the name contains slash or backslash and isn't fully qualified. This avoids the unexpected search and enforces a policy that ctypes in Windows will no longer search the working directory for unqualified names nor load DLLs relative to the working directory. The downside with this approach is that it's inconsistent with POSIX.

Note that os.add_dll_directory won't allow adding ".", so there's no supported way for users to sneak the old behavior back in anyway. The working directory can be restored to the search path by using ctypes to call SetDllDirectoryW("."), but that's beyond our control.

@zooba zooba closed this Mar 18, 2019
@zooba zooba reopened this Mar 18, 2019
@zooba
Copy link
Member Author

zooba commented Mar 19, 2019

@eryksun It looks like HKEY_PERFORMANCE_DATA delay-loads some DLLs that rely on the old resolution method on AppVeyor (the error code is ERROR_MOD_NOT_FOUND as an HRESULT from MSVC). Have you seen anything like this before? Obviously it's not a problem on other machines, so I wonder if they've misconfigured something.

@eryksun
Copy link
Contributor

eryksun commented Mar 19, 2019

HKEY_PERFORMANCE_DATA is a data-collection API packaged as if it's a predefined handle for a registry key. It scans over "HKLM\System\CurrentControlSet\Services" looking for service or driver configurations that have a "Performance" subkey. This should include a "Library" value with the DLL path and the exported function names for "Open", "Close", and "Collect". The implementation skips over DLLs that fail to load, but apparently it doesn't include an exception handler for when the delay-load helper calls RaiseException(ERROR_SEVERITY_ERROR | (FACILITY_VISUALCPP << 16) | ERROR_MOD_NOT_FOUND, ...).

@eryksun
Copy link
Contributor

eryksun commented Mar 19, 2019

apparently it doesn't include an exception handler for when the delay-load helper calls RaiseException

It does not appear to handle this. I added a spam service key that includes the "Performance" subkey and "Library", "Open", "Close", and "Collect" values. I set the library value to "spam.dll", in which I hard coded the exported Open function to call RaiseException(0xC06D007E, 0, 0, NULL). This crashed the process with the following backtrace, starting from RegEnumValueW up to the unhandled exception filter that calls the Windows Error Reporting service:

ntdll!NtWaitForMultipleObjects
KERNELBASE!WaitForMultipleObjectsEx
KERNELBASE!WaitForMultipleObjects
kernel32!WerpReportFaultInternal
kernel32!WerpReportFault
KERNELBASE!UnhandledExceptionFilter
ntdll!RtlUserThreadStart$filt$0
ntdll!_C_specific_handler
ntdll!RtlpExecuteHandlerForException
ntdll!RtlDispatchException
ntdll!RtlRaiseException
KERNELBASE!RaiseException
spam!Open
advapi32!OpenExtObjectLibrary
advapi32!QueryV1Provider
advapi32!QueryExtensibleData
advapi32!PerfRegQueryValueEx
advapi32!PerfRegEnumValue
KERNELBASE!LocalBaseRegEnumValue
KERNELBASE!RegEnumValueW
advapi32!RegEnumValueWStub

Since it ended up in UnhandledExceptionFilter, which is called from the filter in the thread's entrypoint (RtlUserThreadStart), we know that none of the advapi32 functions handled the exception.

@eryksun
Copy link
Contributor

eryksun commented Mar 19, 2019

we know that none of the advapi32 functions handled the exception.

I took a look at `OpenExtObjectLibrary'::`1'::filt$0, which calls the general perflib filter in advapi32, PerfpExceptionFilter. This in turn calls advapi32's ReportError, which reports an event with ID 1009 that includes the failing service and DLL name. It also adds a value in the "Performance" key named "Disable Performance Counters" with a DWORD value of 1, for subsequent calls, and reports another event with ID 1017 to log this. The filter then returns EXCEPTION_CONTINUE_SEARCH (0), which is why it ends up at the uhandled exception filter and crashes the process.

@zooba
Copy link
Member Author

zooba commented Mar 20, 2019

So on one hand, it's a system misconfiguration, and on the other, we can't get this change past CI (because they have a misconfigured system).

I guess we have to leave out the set-default call and live with "I'm not sure how my DLLs are going to be resolved" as a policy.

@zooba
Copy link
Member Author

zooba commented Mar 29, 2019

The Pipelines failure is an unrelated Linux issue, so ignoring the failure to merge.

@zooba zooba merged commit 2438cdf into python:master Mar 29, 2019
@zooba zooba deleted the bpo-36085 branch March 29, 2019 23:38
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows8.1 Non-Debug 3.x has failed when building commit 2438cdf.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/12/builds/2181) and take a look at the build logs.
  4. Check if the failure is related to this commit (2438cdf) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/12/builds/2181

Click to see traceback logs
From https://github.com/python/cpython
 * branch            master     -> FETCH_HEAD
Reset branch 'master'

Could Not Find D:\buildarea\3.x.ware-win81-release\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find D:\buildarea\3.x.ware-win81-release\build\PCbuild\python*.zip

test_grp skipped -- No module named 'grp'
test_poll skipped -- select.poll not defined
test_crypt skipped -- No module named '_crypt'
test_fcntl skipped -- No module named 'fcntl'
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_posix skipped -- No module named 'posix'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\buildarea\3.x.ware-win81-release\build\lib\ctypes\__init__.py", line 361, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\temp\tmpcf8nkkte\_sqlite3.dll'. Try using the full path with constructor syntax.
test_anon (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonmember (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonseq (ctypes.test.test_anon.AnonTest) ... ok
test_issue31490 (ctypes.test.test_anon.AnonTest) ... ok
test_nested (ctypes.test.test_anon.AnonTest) ... ok
test (ctypes.test.test_array_in_pointer.Test) ... ok
test_2 (ctypes.test.test_array_in_pointer.Test) ... ok
test_bad_length (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_bad_subclass (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_cache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_classcache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_address (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_addressW (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_large_array (ctypes.test.test_arrays.ArrayTestCase) ... skipped 'not enough memory: 2.0G minimum needed'
test_numeric_arrays (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_simple (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_subclass (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_zero_length (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_byval (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_callbacks_2 (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_longlong_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_pointers (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_recursive_as_param (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_shorts (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_struct_return_2H (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_struct_return_8H (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_wchar_parm (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_byval (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_callbacks (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_callbacks_2 (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_longlong_callbacks (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_pointers (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_recursive_as_param (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_shorts (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_struct_return_2H (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_struct_return_8H (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_wchar_parm (ctypes.test.test_as_parameter.AsParamWrapperTestCase) ... ok
test_byval (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_callbacks (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_callbacks_2 (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_longlong_callbacks (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_pointers (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_recursive_as_param (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_shorts (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_struct_return_2H (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_struct_return_8H (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_wchar_parm (ctypes.test.test_as_parameter.BasicWrapTestCase) ... ok
test_anon_bitfields (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_c_wchar (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_longlong (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_mixed_1 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_mixed_2 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_mixed_3 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_mixed_4 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_multi_bitfields_size (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_nonint_types (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_signed (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_single_bitfield_size (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_uint32 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_uint32_swap_big_endian (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_uint32_swap_little_endian (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_uint64 (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_ulonglong (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_unsigned (ctypes.test.test_bitfields.BitFieldTest) ... ok
test_ints (ctypes.test.test_bitfields.C_Test) ... ok
test_shorts (ctypes.test.test_bitfields.C_Test) ... ok
test_buffer (ctypes.test.test_buffers.StringBufferTestCase) ... ok
test_buffer_interface (ctypes.test.test_buffers.StringBufferTestCase) ... ok
test_unicode_buffer (ctypes.test.test_buffers.StringBufferTestCase) ... ok
test_unicode_conversion (ctypes.test.test_buffers.StringBufferTestCase) ... ok
test_BSTR (ctypes.test.test_bytes.BytesTest) ... ok
test_c_char (ctypes.test.test_bytes.BytesTest) ... ok
test_c_char_p (ctypes.test.test_bytes.BytesTest) ... ok
test_c_wchar (ctypes.test.test_bytes.BytesTest) ... ok
test_c_wchar_p (ctypes.test.test_bytes.BytesTest) ... ok
test_struct (ctypes.test.test_bytes.BytesTest) ... ok
test_struct_W (ctypes.test.test_bytes.BytesTest) ... ok
test_X (ctypes.test.test_byteswap.Test) ... skipped 'test disabled'
test_endian_double (ctypes.test.test_byteswap.Test) ... ok
test_endian_float (ctypes.test.test_byteswap.Test) ... ok
test_endian_int (ctypes.test.test_byteswap.Test) ... ok
test_endian_longlong (ctypes.test.test_byteswap.Test) ... ok
test_endian_other (ctypes.test.test_byteswap.Test) ... ok
test_endian_short (ctypes.test.test_byteswap.Test) ... ok
test_slots (ctypes.test.test_byteswap.Test) ... ok
test_struct_fields_1 (ctypes.test.test_byteswap.Test) ... ok
test_struct_fields_2 (ctypes.test.test_byteswap.Test) ... ok
test_struct_struct (ctypes.test.test_byteswap.Test) ... ok
test_unaligned_native_struct_fields (ctypes.test.test_byteswap.Test) ... ok
test_unaligned_nonnative_struct_fields (ctypes.test.test_byteswap.Test) ... ok
test_byte (ctypes.test.test_callbacks.Callbacks) ... ok
test_char (ctypes.test.test_callbacks.Callbacks) ... ok
test_char_p (ctypes.test.test_callbacks.Callbacks) ... skipped 'test disabled'
test_double (ctypes.test.test_callbacks.Callbacks) ... ok
test_float (ctypes.test.test_callbacks.Callbacks) ... ok
test_int (ctypes.test.test_callbacks.Callbacks) ... ok
test_issue12483 (ctypes.test.test_callbacks.Callbacks) ... ok
test_issue_7959 (ctypes.test.test_callbacks.Callbacks) ... ok
test_long (ctypes.test.test_callbacks.Callbacks) ... ok
test_longdouble (ctypes.test.test_callbacks.Callbacks) ... ok
test_longlong (ctypes.test.test_callbacks.Callbacks) ... ok
test_pyobject (ctypes.test.test_callbacks.Callbacks) ... ok
test_short (ctypes.test.test_callbacks.Callbacks) ... ok
test_ubyte (ctypes.test.test_callbacks.Callbacks) ... ok
test_uint (ctypes.test.test_callbacks.Callbacks) ... ok
test_ulong (ctypes.test.test_callbacks.Callbacks) ... ok
test_ulonglong (ctypes.test.test_callbacks.Callbacks) ... ok
test_unsupported_restype_1 (ctypes.test.test_callbacks.Callbacks) ... ok
test_unsupported_restype_2 (ctypes.test.test_callbacks.Callbacks) ... ok
test_ushort (ctypes.test.test_callbacks.Callbacks) ... ok
test_callback_large_struct (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... ok
test_callback_register_double (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... ok
test_callback_register_int (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... ok
test_integrate (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... ok
test_issue_8959_a (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... skipped 'could not find libc'
test_issue_8959_b (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... ok
test_byte (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_char (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_char_p (ctypes.test.test_callbacks.StdcallCallbacks) ... skipped 'test disabled'
test_double (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_float (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_int (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_issue12483 (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_issue_7959 (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_long (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_longdouble (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_longlong (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_pyobject (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_short (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_ubyte (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_uint (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_ulong (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_ulonglong (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_unsupported_restype_1 (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_unsupported_restype_2 (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_ushort (ctypes.test.test_callbacks.StdcallCallbacks) ... ok
test_address2pointer (ctypes.test.test_cast.Test) ... ok
test_array2pointer (ctypes.test.test_cast.Test) ... ok
test_bad_type_arg (ctypes.test.test_cast.Test) ... ok
test_char_p (ctypes.test.test_cast.Test) ... ok
test_other (ctypes.test.test_cast.Test) ... ok
test_p2a_objects (ctypes.test.test_cast.Test) ... ok
test_wchar_p (ctypes.test.test_cast.Test) ... ok
test_byte (ctypes.test.test_cfuncs.CFunctions) ... ok
test_byte_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_callwithresult (ctypes.test.test_cfuncs.CFunctions) ... ok
test_double (ctypes.test.test_cfuncs.CFunctions) ... ok
test_double_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_float (ctypes.test.test_cfuncs.CFunctions) ... ok
test_float_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_int (ctypes.test.test_cfuncs.CFunctions) ... ok
test_int_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_long (ctypes.test.test_cfuncs.CFunctions) ... ok
test_long_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_longdouble (ctypes.test.test_cfuncs.CFunctions) ... ok
test_longdouble_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_longlong (ctypes.test.test_cfuncs.CFunctions) ... ok
test_longlong_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_short (ctypes.test.test_cfuncs.CFunctions) ... ok
test_short_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ubyte (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ubyte_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_uint (ctypes.test.test_cfuncs.CFunctions) ... ok
test_uint_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ulong (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ulong_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ulonglong (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ulonglong_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ushort (ctypes.test.test_cfuncs.CFunctions) ... ok
test_ushort_plus (ctypes.test.test_cfuncs.CFunctions) ... ok
test_void (ctypes.test.test_cfuncs.CFunctions) ... ok
test_byte (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_byte_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_callwithresult (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_double (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_double_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_float (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_float_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_int (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_int_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_long (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_long_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_longdouble (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_longdouble_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_longlong (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_longlong_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_short (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_short_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ubyte (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ubyte_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_uint (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_uint_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ulong (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ulong_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ulonglong (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ulonglong_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ushort (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_ushort_plus (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_void (ctypes.test.test_cfuncs.stdcallCFunctions) ... ok
test_checkretval (ctypes.test.test_checkretval.Test) ... ok
test_oledll (ctypes.test.test_checkretval.Test) ... ok
test_chararray (ctypes.test.test_delattr.TestCase) ... ok
test_simple (ctypes.test.test_delattr.TestCase) ... ok
test_struct (ctypes.test.test_delattr.TestCase) ... ok
test_GetLastError (ctypes.test.test_errno.Test) ... ok
test_open (ctypes.test.test_errno.Test) ... skipped 'Unable to find C library'
test_find_on_libpath (ctypes.test.test_find.LibPathFindTest) ... skipped 'Test only valid for Linux'
OpenGL libraries:
	 ('GL', 'C:\\Windows\\system32\\OpenGL32.dll')
	 ('GLU', 'C:\\Windows\\system32\\Glu32.dll')
	 ('gle', None)
test_gl (ctypes.test.test_find.Test_OpenGL_libs) ... ok
test_gle (ctypes.test.test_find.Test_OpenGL_libs) ... skipped 'lib_gle not available'
test_glu (ctypes.test.test_find.Test_OpenGL_libs) ... ok
test_shell_injection (ctypes.test.test_find.Test_OpenGL_libs) ... ok
test_abstract (ctypes.test.test_frombuffer.Test) ... ok
test_fortran_contiguous (ctypes.test.test_frombuffer.Test) ... ok
test_from_buffer (ctypes.test.test_frombuffer.Test) ... ok
test_from_buffer_copy (ctypes.test.test_frombuffer.Test) ... ok
test_from_buffer_copy_with_offset (ctypes.test.test_frombuffer.Test) ... ok
test_from_buffer_memoryview (ctypes.test.test_frombuffer.Test) ... ok
test_from_buffer_with_offset (ctypes.test.test_frombuffer.Test) ... ok
test_abstract (ctypes.test.test_funcptr.CFuncPtrTestCase) ... ok
test_basic (ctypes.test.test_funcptr.CFuncPtrTestCase) ... ok
test_dllfunctions (ctypes.test.test_funcptr.CFuncPtrTestCase) ... ok
test_first (ctypes.test.test_funcptr.CFuncPtrTestCase) ... ok
test_structures (ctypes.test.test_funcptr.CFuncPtrTestCase) ... ok
test_byval (ctypes.test.test_functions.FunctionTestCase) ... ok
test_callbacks (ctypes.test.test_functions.FunctionTestCase) ... ok
test_callbacks_2 (ctypes.test.test_functions.FunctionTestCase) ... ok
test_doubleresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_errors (ctypes.test.test_functions.FunctionTestCase) ... ok
test_floatresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_intresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_longdoubleresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_longlong_callbacks (ctypes.test.test_functions.FunctionTestCase) ... ok
test_longlongresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_mro (ctypes.test.test_functions.FunctionTestCase) ... ok
test_pointers (ctypes.test.test_functions.FunctionTestCase) ... ok
test_sf1651235 (ctypes.test.test_functions.FunctionTestCase) ... ok
test_shorts (ctypes.test.test_functions.FunctionTestCase) ... ok
test_stringresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_struct_return_2H (ctypes.test.test_functions.FunctionTestCase) ... ok
test_struct_return_2H_stdcall (ctypes.test.test_functions.FunctionTestCase) ... ok
test_struct_return_8H (ctypes.test.test_functions.FunctionTestCase) ... ok
test_struct_return_8H_stdcall (ctypes.test.test_functions.FunctionTestCase) ... ok
test_voidresult (ctypes.test.test_functions.FunctionTestCase) ... ok
test_wchar_parm (ctypes.test.test_functions.FunctionTestCase) ... ok
test_wchar_result (ctypes.test.test_functions.FunctionTestCase) ... ok
test_incomplete_example (ctypes.test.test_incomplete.MyTestCase) ... ok
test_get (ctypes.test.test_init.InitTest) ... ok
test_c_char_p (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_embedded_structs (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_ints (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_ptr_struct (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_simple_struct (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_xxx (ctypes.test.test_internals.ObjectsTestCase) ... ok
test_cint_array (ctypes.test.test_keeprefs.ArrayTestCase) ... ok
test_X (ctypes.test.test_keeprefs.DeletePointerTestCase) ... skipped 'test disabled'
test_p_cint (ctypes.test.test_keeprefs.PointerTestCase) ... ok
test (ctypes.test.test_keeprefs.PointerToStructure) ... ok
test_ccharp (ctypes.test.test_keeprefs.SimpleTestCase) ... ok
test_cint (ctypes.test.test_keeprefs.SimpleTestCase) ... ok
test_ccharp_struct (ctypes.test.test_keeprefs.StructureTestCase) ... ok
test_cint_struct (ctypes.test.test_keeprefs.StructureTestCase) ... ok
test_struct_struct (ctypes.test.test_keeprefs.StructureTestCase) ... ok
test_qsort (ctypes.test.test_libc.LibTest) ... ok
test_sqrt (ctypes.test.test_libc.LibTest) ... ok
libc_name is None
test_1703286_A (ctypes.test.test_loading.LoaderTest) ... ok
test_1703286_B (ctypes.test.test_loading.LoaderTest) ... ok
test_find (ctypes.test.test_loading.LoaderTest) ... ok
test_load (ctypes.test.test_loading.LoaderTest) ... skipped 'could not find libc'
test_load_dll_with_flags (ctypes.test.test_loading.LoaderTest) ... test_load_library (ctypes.test.test_loading.LoaderTest) ... C:\Windows\system32\kernel32.dll
C:\Windows\system32\user32.dll
ok
test_load_ordinal_functions (ctypes.test.test_loading.LoaderTest) ... ok
test_load_version (ctypes.test.test_loading.LoaderTest) ... skipped 'could not find libc'
test_find (ctypes.test.test_macholib.MachOTest) ... skipped 'OSX-specific test'
test_cast (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok
test_memmove (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok
test_memset (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok
test_overflow (ctypes.test.test_memfunctions.MemFunctionsTest) ... skipped 'test disabled'
test_string_at (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok
test_wstring_at (ctypes.test.test_memfunctions.MemFunctionsTest) ... ok
test_alignments (ctypes.test.test_numbers.NumberTestCase) ... ok
test_bool_from_address (ctypes.test.test_numbers.NumberTestCase) ... skipped 'test disabled'
test_bool_values (ctypes.test.test_numbers.NumberTestCase) ... ok
test_byref (ctypes.test.test_numbers.NumberTestCase) ... ok
test_char_from_address (ctypes.test.test_numbers.NumberTestCase) ... ok
test_default_init (ctypes.test.test_numbers.NumberTestCase) ... ok
test_float_from_address (ctypes.test.test_numbers.NumberTestCase) ... ok
test_float_overflow (ctypes.test.test_numbers.NumberTestCase) ... ok
test_floats (ctypes.test.test_numbers.NumberTestCase) ... ok
test_from_param (ctypes.test.test_numbers.NumberTestCase) ... ok
test_init (ctypes.test.test_numbers.NumberTestCase) ... ok
test_int_from_address (ctypes.test.test_numbers.NumberTestCase) ... ok
test_integers (ctypes.test.test_numbers.NumberTestCase) ... ok
test_perf (ctypes.test.test_numbers.NumberTestCase) ... skipped 'test disabled'
test_signed_values (ctypes.test.test_numbers.NumberTestCase) ... ok
test_sizes (ctypes.test.test_numbers.NumberTestCase) ... ok
test_typeerror (ctypes.test.test_numbers.NumberTestCase) ... ok
test_unsigned_values (ctypes.test.test_numbers.NumberTestCase) ... ok
test_valid_ranges (ctypes.test.test_numbers.NumberTestCase) ... skipped 'test disabled'
test (ctypes.test.test_objects.TestCase) ... ok
test_abstract (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_array_pointers (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_byref_pointer (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_byref_pointerpointer (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_cstrings (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_cw_strings (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_int_pointers (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_issue31311 (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_noctypes_argtype (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_subclasses (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_subclasses_c_wchar_p (ctypes.test.test_parameters.SimpleTypesTestCase) ... ok
test_endian_types (ctypes.test.test_pep3118.Test) ... ok
test_native_types (ctypes.test.test_pep3118.Test) ... ok
test_simple (ctypes.test.test_pickling.PickleTest_0) ... ok
test_struct (ctypes.test.test_pickling.PickleTest_0) ... ok
test_unpickable (ctypes.test.test_pickling.PickleTest_0) ... ok
test_wchar (ctypes.test.test_pickling.PickleTest_0) ... ok
test_simple (ctypes.test.test_pickling.PickleTest_1) ... ok
test_struct (ctypes.test.test_pickling.PickleTest_1) ... ok
test_unpickable (ctypes.test.test_pickling.PickleTest_1) ... ok
test_wchar (ctypes.test.test_pickling.PickleTest_1) ... ok
test_simple (ctypes.test.test_pickling.PickleTest_2) ... ok
test_struct (ctypes.test.test_pickling.PickleTest_2) ... ok
test_unpickable (ctypes.test.test_pickling.PickleTest_2) ... ok
test_wchar (ctypes.test.test_pickling.PickleTest_2) ... ok
test_simple (ctypes.test.test_pickling.PickleTest_3) ... ok
test_struct (ctypes.test.test_pickling.PickleTest_3) ... ok
test_unpickable (ctypes.test.test_pickling.PickleTest_3) ... ok
test_wchar (ctypes.test.test_pickling.PickleTest_3) ... ok
test_simple (ctypes.test.test_pickling.PickleTest_4) ... ok
test_struct (ctypes.test.test_pickling.PickleTest_4) ... ok
test_unpickable (ctypes.test.test_pickling.PickleTest_4) ... ok
test_wchar (ctypes.test.test_pickling.PickleTest_4) ... ok
test_abstract (ctypes.test.test_pointers.PointersTestCase) ... ok
test_basic (ctypes.test.test_pointers.PointersTestCase) ... ok
test_basics (ctypes.test.test_pointers.PointersTestCase) ... ok
test_bug_1467852 (ctypes.test.test_pointers.PointersTestCase) ... ok
test_c_void_p (ctypes.test.test_pointers.PointersTestCase) ... ok
test_callbacks_with_pointers (ctypes.test.test_pointers.PointersTestCase) ... ok
test_change_pointers (ctypes.test.test_pointers.PointersTestCase) ... ok
test_charpp (ctypes.test.test_pointers.PointersTestCase)
Test that a character pointer-to-pointer is correctly passed ... ok
test_from_address (ctypes.test.test_pointers.PointersTestCase) ... ok
test_other (ctypes.test.test_pointers.PointersTestCase) ... ok
test_pass_pointers (ctypes.test.test_pointers.PointersTestCase) ... ok
test_pointer_crash (ctypes.test.test_pointers.PointersTestCase) ... ok
test_pointer_type_name (ctypes.test.test_pointers.PointersTestCase) ... ok
test_pointer_type_str_name (ctypes.test.test_pointers.PointersTestCase) ... ok
test_pointers_bool (ctypes.test.test_pointers.PointersTestCase) ... ok
test (ctypes.test.test_prototypes.ArrayTest) ... ok
test_POINTER_c_char_arg (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_c_char_p_arg (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_c_void_p_arg (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_c_void_p_arg_with_c_wchar_p (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_instance (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_int_pointer_arg (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_paramflags (ctypes.test.test_prototypes.CharPointersTestCase) ... ok
test_POINTER_c_wchar_arg (ctypes.test.test_prototypes.WCharPointersTestCase) ... ok
test_c_wchar_p_arg (ctypes.test.test_prototypes.WCharPointersTestCase) ... ok
test_PyBytes_FromStringAndSize (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_PyLong_Long (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_PyOS_snprintf (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_PyObj_FromPtr (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_PyString_FromString (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_pyobject_repr (ctypes.test.test_python_api.PythonAPITestCase) ... ok
test_FloatDivisionError (ctypes.test.test_random_things.CallbackTracbackTestCase) ... ok
test_IntegerDivisionError (ctypes.test.test_random_things.CallbackTracbackTestCase) ... ok
test_TypeErrorDivisionError (ctypes.test.test_random_things.CallbackTracbackTestCase) ... ok
test_ValueError (ctypes.test.test_random_things.CallbackTracbackTestCase) ... ok
test (ctypes.test.test_random_things.call_function_TestCase) ... ok
test_callback (ctypes.test.test_refcounts.AnotherLeak) ... ok
test_1 (ctypes.test.test_refcounts.RefcountTestCase) ... ok
test_refcount (ctypes.test.test_refcounts.RefcountTestCase) ... ok
test_char (ctypes.test.test_repr.ReprTest) ... ok
test_numbers (ctypes.test.test_repr.ReprTest) ... ok
test_from_dll (ctypes.test.test_returnfuncptrs.ReturnFuncPtrTestCase) ... ok
test_from_dll_refcount (ctypes.test.test_returnfuncptrs.ReturnFuncPtrTestCase) ... ok
test_with_prototype (ctypes.test.test_returnfuncptrs.ReturnFuncPtrTestCase) ... ok
test_without_prototype (ctypes.test.test_returnfuncptrs.ReturnFuncPtrTestCase) ... ok
test_compare (ctypes.test.test_simplesubclasses.Test) ... ok
test_ignore_retval (ctypes.test.test_simplesubclasses.Test) ... ok
test_int_callback (ctypes.test.test_simplesubclasses.Test) ... ok
test_int_struct (ctypes.test.test_simplesubclasses.Test) ... ok
test_16 (ctypes.test.test_sizes.SizesTestCase) ... ok
test_32 (ctypes.test.test_sizes.SizesTestCase) ... ok
test_64 (ctypes.test.test_sizes.SizesTestCase) ... ok
test_8 (ctypes.test.test_sizes.SizesTestCase) ... ok
test_size_t (ctypes.test.test_sizes.SizesTestCase) ... ok
test_ssize_t (ctypes.test.test_sizes.SizesTestCase) ... ok
test_char_array (ctypes.test.test_slicing.SlicesTestCase) ... ok
test_char_ptr (ctypes.test.test_slicing.SlicesTestCase) ... ok
test_char_ptr_with_free (ctypes.test.test_slicing.SlicesTestCase) ... ok
test_getslice_cint (ctypes.test.test_slicing.SlicesTestCase) ... ok
test_setslice_cint (ctypes.test.test_slicing.SlicesTestCase) ... ok
test_wchar_ptr (ctypes.test.test_slicing.SlicesTestCase) ... ok
test__POINTER_c_char (ctypes.test.test_stringptr.StringPtrTestCase) ... ok
test__c_char_p (ctypes.test.test_stringptr.StringPtrTestCase) ... ok
test_functions (ctypes.test.test_stringptr.StringPtrTestCase) ... ok
test (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_c_buffer_raw (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_c_buffer_value (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_del_segfault (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_param_1 (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_param_2 (ctypes.test.test_strings.StringArrayTestCase) ... ok
test_basic_strings (ctypes.test.test_strings.StringTestCase) ... skipped 'test disabled'
test_initialized_strings (ctypes.test.test_strings.StringTestCase) ... skipped 'test disabled'
test_perf (ctypes.test.test_strings.StringTestCase) ... skipped 'test disabled'
test_sized_strings (ctypes.test.test_strings.StringTestCase) ... skipped 'test disabled'
test_toolong (ctypes.test.test_strings.StringTestCase) ... skipped 'test disabled'
test (ctypes.test.test_strings.WStringArrayTestCase) ... ok
test_nonbmp (ctypes.test.test_strings.WStringArrayTestCase) ... skipped 'sizeof(wchar_t) is smaller than 4 bytes'
test_basic_wstrings (ctypes.test.test_strings.WStringTestCase) ... skipped 'test disabled'
test_toolong (ctypes.test.test_strings.WStringTestCase) ... skipped 'test disabled'
test_wchar (ctypes.test.test_strings.WStringTestCase) ... ok
test_1_A (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test_1_B (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test_2 (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test_3 (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test_4 (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test___get__ (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test___set__ (ctypes.test.test_struct_fields.StructFieldsTestCase) ... ok
test (ctypes.test.test_structures.PointerMemberTestCase) ... ok
test_none_to_pointer_fields (ctypes.test.test_structures.PointerMemberTestCase) ... ok
test_abstract_class (ctypes.test.test_structures.StructureTestCase) ... ok
test_conflicting_initializers (ctypes.test.test_structures.StructureTestCase) ... ok
test_empty (ctypes.test.test_structures.StructureTestCase) ... ok
test_fields (ctypes.test.test_structures.StructureTestCase) ... ok
test_huge_field_name (ctypes.test.test_structures.StructureTestCase) ... ok
test_init_errors (ctypes.test.test_structures.StructureTestCase) ... ok
test_initializers (ctypes.test.test_structures.StructureTestCase) ... ok
test_intarray_fields (ctypes.test.test_structures.StructureTestCase) ... ok
test_invalid_field_types (ctypes.test.test_structures.StructureTestCase) ... ok
test_invalid_name (ctypes.test.test_structures.StructureTestCase) ... ok
test_keyword_initializers (ctypes.test.test_structures.StructureTestCase) ... ok
test_methods (ctypes.test.test_structures.StructureTestCase) ... ok
test_nested_initializers (ctypes.test.test_structures.StructureTestCase) ... ok
test_packed (ctypes.test.test_structures.StructureTestCase) ... ok
test_packed_c_limits (ctypes.test.test_structures.StructureTestCase) ... ok
test_pass_by_value (ctypes.test.test_structures.StructureTestCase) ... ok
test_pass_by_value_in_register (ctypes.test.test_structures.StructureTestCase) ... ok
test_positional_args (ctypes.test.test_structures.StructureTestCase) ... ok
test_simple_structs (ctypes.test.test_structures.StructureTestCase) ... ok
test_struct_alignment (ctypes.test.test_structures.StructureTestCase) ... ok
test_structures_with_wchar (ctypes.test.test_structures.StructureTestCase) ... ok
test_subclass_creation (ctypes.test.test_structures.StructureTestCase) ... skipped 'test disabled'
test_unions (ctypes.test.test_structures.StructureTestCase) ... ok
test_subclass (ctypes.test.test_structures.SubclassesTest) ... ok
test_subclass_delayed (ctypes.test.test_structures.SubclassesTest) ... ok
test_contains_itself (ctypes.test.test_structures.TestRecursiveStructure) ... ok
test_vice_versa (ctypes.test.test_structures.TestRecursiveStructure) ... ok
test_native (ctypes.test.test_unaligned_structures.TestStructures) ... ok
test_swapped (ctypes.test.test_unaligned_structures.TestStructures) ... ok
test_buffers (ctypes.test.test_unicode.StringTestCase) ... ok
test_func (ctypes.test.test_unicode.StringTestCase) ... ok
test_wcslen (ctypes.test.test_unicode.StringTestCase) ... ok
test_buffers (ctypes.test.test_unicode.UnicodeTestCase) ... ok
test_wcslen (ctypes.test.test_unicode.UnicodeTestCase) ... ok
test_frozentable (ctypes.test.test_values.PythonValuesTestCase) ... ok
test_optimizeflag (ctypes.test.test_values.PythonValuesTestCase) ... ok
test_undefined (ctypes.test.test_values.PythonValuesTestCase) ... ok
test_an_integer (ctypes.test.test_values.ValuesTestCase) ... ok
test_undefined (ctypes.test.test_values.ValuesTestCase) ... ok
test_array_invalid_length (ctypes.test.test_varsize_struct.VarSizeTest) ... ok
test_resize (ctypes.test.test_varsize_struct.VarSizeTest) ... ok
test_zerosized_array (ctypes.test.test_varsize_struct.VarSizeTest) ... ok
test_SEH (ctypes.test.test_win32.FunctionCallTestCase) ... ok
test_noargs (ctypes.test.test_win32.FunctionCallTestCase) ... ok
test_sizes (ctypes.test.test_win32.ReturnStructSizesTestCase) ... ok
test_struct_by_value (ctypes.test.test_win32.Structures) ... ok
test_winerror (ctypes.test.test_win32.TestWinError) ... ok
test_COMError (ctypes.test.test_win32.TestWintypes) ... ok
test_HWND (ctypes.test.test_win32.TestWintypes) ... ok
test_PARAM (ctypes.test.test_win32.TestWintypes) ... ok
test_variant_bool (ctypes.test.test_wintypes.WinTypesTest) ... ok

======================================================================
ERROR: test_load_dll_with_flags (ctypes.test.test_loading.LoaderTest) [WinDLL(nt._getfullpathname('_sqlite3.dll'), winmode=nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.ware-win81-release\build\lib\ctypes\test\test_loading.py", line 140, in should_pass
    subprocess.check_output(
  File "D:\buildarea\3.x.ware-win81-release\build\lib\subprocess.py", line 396, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "D:\buildarea\3.x.ware-win81-release\build\lib\subprocess.py", line 488, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['D:\\buildarea\\3.x.ware-win81-release\\build\\PCbuild\\amd64\\python.exe', '-c', "from ctypes import *; import nt;WinDLL(nt._getfullpathname('_sqlite3.dll'), winmode=nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)"]' returned non-zero exit status 1.

----------------------------------------------------------------------

Ran 473 tests in 0.972s

FAILED (errors=1, skipped=25)
test test_ctypes failed
test_devpoll skipped -- test works only on Solaris OS family
test_ossaudiodev skipped -- No module named 'ossaudiodev'
test_pty skipped -- No module named 'termios'
test_readline skipped -- No module named 'readline'
test_multiprocessing_fork skipped -- fork is not available on Windows
test_multiprocessing_forkserver skipped -- forkserver is not available on Windows
test_ioctl skipped -- No module named 'fcntl'
test_gdb skipped -- Couldn't find gdb on the path
test_pwd skipped -- No module named 'pwd'
test_spwd skipped -- No module named 'spwd'
test_kqueue skipped -- test works only on BSD
test_syslog skipped -- No module named 'syslog'
test_openpty skipped -- os.openpty() not available.
test_wait4 skipped -- object <module 'os' from 'D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\os.py'> has no attribute 'fork'
test_nis skipped -- No module named 'nis'
test_xxtestfuzz skipped -- No module named '_xxtestfuzz'
test_curses skipped -- No module named '_curses'
test_epoll skipped -- test works only on Linux 2.6
test_pipes skipped -- pipes module only works on posix
test_dbm_gnu skipped -- No module named '_gdbm'
test_threadsignals skipped -- Can't test signal on win32
test_dbm_ndbm skipped -- No module named '_dbm'
test_fork1 skipped -- object <module 'os' from 'D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\os.py'> has no attribute 'fork'
test_resource skipped -- No module named 'resource'
test_wait3 skipped -- os.fork not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\buildarea\3.x.ware-win81-release\build\lib\ctypes\__init__.py", line 361, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\temp\tmpdgnmxkoc\_sqlite3.dll'. Try using the full path with constructor syntax.
test test_ctypes failed

Could Not Find D:\buildarea\3.x.ware-win81-release\build\PCbuild\python*.zip

lazka added a commit to lazka/MINGW-packages that referenced this pull request Apr 16, 2019
…#5146

This is also a problem with meson which tries to execute things in the build
directory using the build directory DLLs by prepending those to PATH.
Since meson uses a Python helper the PATH gets updated to include the
system prefix first which makes things link against the installed libraries
instead and fail because symbols are missing.

One of the reasons why this was added in the first place is that Python loads
C extensions in lib-dynload which then can't find the libraries in prefix
(e.g. "import tkinter") if it isn't in PATH.

By moving the prefix at the end of PATH we make both cases work.

Starting with Python 3.8 C extensions will no longer use PATH for loading
DLL dependencies, see python/cpython#12302
so we will have to look into this again then.
lazka added a commit to lazka/MINGW-packages that referenced this pull request Apr 16, 2019
…5146

This is also a problem with meson which tries to execute things in the build
directory using the build directory DLLs by prepending those to PATH.
Since meson uses a Python helper the PATH gets updated to include the
system prefix first which makes things link against the installed libraries
instead and fail because symbols are missing.

One of the reasons why this was added in the first place is that Python loads
C extensions in lib-dynload which then can't find the libraries in prefix
(e.g. "import tkinter") if it isn't in PATH.

By moving the prefix at the end of PATH we make both cases work.

Starting with Python 3.8 C extensions will no longer use PATH for loading
DLL dependencies, see python/cpython#12302
so we will have to look into this again then.
stahta01 pushed a commit to stahta01/MINGW-packages that referenced this pull request Apr 21, 2019
…5146

This is also a problem with meson which tries to execute things in the build
directory using the build directory DLLs by prepending those to PATH.
Since meson uses a Python helper the PATH gets updated to include the
system prefix first which makes things link against the installed libraries
instead and fail because symbols are missing.

One of the reasons why this was added in the first place is that Python loads
C extensions in lib-dynload which then can't find the libraries in prefix
(e.g. "import tkinter") if it isn't in PATH.

By moving the prefix at the end of PATH we make both cases work.

Starting with Python 3.8 C extensions will no longer use PATH for loading
DLL dependencies, see python/cpython#12302
so we will have to look into this again then.
jobovy added a commit to jobovy/galpy that referenced this pull request Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants