Closed odd-meta closed 5 years ago
There's something strange going on here...
I suspect that something has changed in pywin32... Can you please confirm what version you have installed?
From my C:\Python27\Lib\site-packages\pywin32-224.dist-info\METADATA file:
Metadata-Version: 2.0
Name: pywin32
Version: 224
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: mhammond@skippinet.com.au
License: PSF
Description-Content-Type: UNKNOWN
Platform: UNKNOWN
Thanks. I don't have access to my windows machines for a couple of weeks, so can't compare with them, but given the release date for version 224, I know that I'll be using an earlier version.
In the meantime, could you please confirm whethr you are using a 32 or 64 bit build of python and how you installed your version of pywin32? Also if you could try a version before build 220, I think you'd be in the right ballpark for the last time I installed the package.
Python 2.7.15 appears to be 64 bit
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
I installed pywin32 via pip during dependency install for the first run of asciimatics.
For this testing I pip uninstalled that copy of pywin32 and obtained installer versions for all testing outlined below. For testing of version 221 and higher installers were sourced from: https://github.com/mhammond/pywin32/releases. For these I used the pywin32-vvv.win-amd64-py2.7.exe variants. For versions of pywin32 older than version 221 installers were sourced from https://sourceforge.net/projects/pywin32/files/pywin32/.
I based my testing on versions listed in the pywin32 release history with 210 omitted for age. Some of the steps below are redundant; I tried to keep the steps and order as similar as possible to help me not screw up testing.
Observed the same error as before
File "C:\Python27\lib\site-packages\asciimatics\screen.py", line 2107, in wait_for_input
rc = win32event.WaitForSingleObject(self._stdin, timeout * 1000)
SystemError: ..\Objects\longobject.c:463: bad argument to internal function
Observed a different error
File "C:\Python27\lib\site-packages\asciimatics\screen.py", line 2107, in wait_for_input
rc = win32event.WaitForSingleObject(self._stdin, timeout * 1000)
TypeError: integer argument expected, got float
Observed the same error as initial error
File "C:\Python27\lib\site-packages\asciimatics\screen.py", line 2107, in wait_for_input
rc = win32event.WaitForSingleObject(self._stdin, timeout * 1000)
SystemError: ..\Objects\longobject.c:463: bad argument to internal function
Observed the same error as initial error
File "C:\Python27\lib\site-packages\asciimatics\screen.py", line 2107, in wait_for_input
rc = win32event.WaitForSingleObject(self._stdin, timeout * 1000)
SystemError: ..\Objects\longobject.c:463: bad argument to internal function
I am suspicious that this is a real issue until it can be replicated on a Windows machine beyond my own. Like any development-ish machine this one has drifted pretty far from a 'normal' configuration and setup over the years. If I had a functional Windows VM handy I would give that a try, unfortunately I do not.
That was a rigorous response! Thanks.
I'm beginning to wonder if I somehow got away with a floating point number when I developed this function and am now being picked up on that by newer builds of pywin32. If casting to an int instead of a long (so that it will work on python 3) fixes it for you, I'm happy to take that as the fix instead.
Issues fixed by this PR
Fix for argument error to win32.event.WaitForSingleObject found on Windows 10 with Python 2.7.15.
What does this implement/fix?
Attempting to run samples/contact_list.py on Windows 10 with Python 2.7.15 without this fix results in the following error:
Not sure if this is the right fix, or the best fix, but samples/contact_list.py runs after it is applied, as do all the tests in the tests directory.