[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2021-04-16 Thread David Heffernan
David Heffernan added the comment: @Steve as a user of Python rather than a Python developer, I don't know what the process here. I understand the need for a test, and then a fix. And I would not be surprised if the act of fixing the issue led to a broadening of the test if the scope

[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan
David Heffernan added the comment: I would approve of that On Tue, 7 Jan 2020, 20:43 Steve Dower, wrote: > > Steve Dower added the comment: > > In that case, we should refactor the init method to check whether handle > has been specified earlier, so that it's obvio

[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan
David Heffernan added the comment: Personally I'd hang this off whether handle has been specified. It seems pointless to set the mode if you are never going to use it. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan
New submission from David Heffernan : When creating an instance of CDLL (or indeed WinDLL) for a DLL that is already loaded, you pass the HMODULE in the handle argument to the constructor. In older versions of ctypes you could pass None as the name argument when doing so. However

[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2019-11-08 Thread David Heffernan
New submission from David Heffernan : Starting with Python 3.8 certain ctypes callbacks fail to restore the stack pointer. In the repo below, when the DLL is compiled with MSVC under default debug settings, running the Python script leads to a debug error dialog which says: Run-Time Check

[issue16865] ctypes arrays >=2GB in length causes exception

2017-05-10 Thread David Heffernan
David Heffernan added the comment: Erik, As you can no doubt guess, this is related to the questions I have been asking on SO that you have so expertly been answering. Thank you! When I solved the latest problem, getting at the internal buffer of a bytearray, I used the code in my previous

[issue16865] ctypes arrays >=2GB in length causes exception

2017-05-10 Thread David Heffernan
David Heffernan added the comment: I just ran into this issue. I'm trying to write code like this: (ctypes.c_char*bufferLen).from_buffer(buffer) where buffer is a bytearray. When bufferLen is greater than 2GB I fail foul of this code in _ctypes.c long length; length

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-27 Thread David Heffernan
David Heffernan added the comment: Thanks for following up Steve, and thanks for changing resolution to dupe. As for 3.5 and embedding the docs are much the same as 2.7 in that the example code at https://docs.python.org/3/extending/embedding.html doesn't explicitly set Python home. Anyway

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-21 Thread David Heffernan
David Heffernan added the comment: Why was this closed as "not a bug"? Shouldn't it have been closed as a duplicate? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-14 Thread David Heffernan
David Heffernan added the comment: Thanks Eryk, everything you described happens exactly as you describe it. Much appreciated. As it happens, I'm not distributing Python because I want to give my users the flexibility to use whatever version they please, and with whatever third party modules

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-14 Thread David Heffernan
David Heffernan added the comment: Note that I've just listed the Windows versions on which I have tested this. I have not tested on Windows 7 or Vista so do not know whether or not the issue exists there. -- ___ Python tracker <

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-14 Thread David Heffernan
New submission from David Heffernan: Environment: - Python 2.7.11 from python.org, x64. - Windows 10 or Windows 8.1 - MSVC 2015 I compiled the most basic embedding example, taken from the Python docs: #include int main(int argc, char *argv[]) { Py_SetProgramName(argv[0]); /* optional