[issue28474] WinError(): Python int too large to convert to C long

2016-10-19 Thread Kelvin You
Kelvin You added the comment: Here is the full list of windows error code: https://msdn.microsoft.com/en-us/library/cc231196.aspx You can see a lot of error codes is above 0x8000. -- ___ Python tracker <rep...@bugs.python.org>

[issue28474] WinError(): Python int too large to convert to C long

2016-10-19 Thread Kelvin You
Kelvin You added the comment: I report this issue because the function WlanScan(https://msdn.microsoft.com/zh-cn/library/windows/desktop/ms706783(v=vs.85).aspx) returns a error code 0x80342002 when the WLAN is disabled on Windows 10. ctypes.WinError() raise an exception of 'Python int too

[issue28474] WinError(): Python int too large to convert to C long

2016-10-19 Thread Kelvin You
New submission from Kelvin You: // callproc.c static PyObject *format_error(PyObject *self, PyObject *args) { PyObject *result; wchar_t *lpMsgBuf; DWORD code = 0; if (!PyArg_ParseTuple(args, "|i:FormatError", )) ^ Here the format str