Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7024/win32/src
Modified Files:
win32file.i
Log Message:
In ReadFile, use PyInt_AsLong instead of PyLong_AsUnsignedLong for buffer size since it won't convert a plain int in Python 2.3
Index: win32file.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** win32file.i 3 Jun 2007 14:53:07 -0000 1.83
--- win32file.i 5 Jun 2007 09:47:46 -0000 1.84
***************
*** 890,894 ****
PyBufferProcs *pb = NULL;
! bufSize = PyLong_AsUnsignedLong(obBuf);
if ((bufSize!=(DWORD)-1) || !PyErr_Occurred()){
if (pOverlapped){ // guaranteed to be NULL on CE
--- 890,894 ----
PyBufferProcs *pb = NULL;
! bufSize = PyInt_AsLong(obBuf);
if ((bufSize!=(DWORD)-1) || !PyErr_Occurred()){
if (pOverlapped){ // guaranteed to be NULL on CE
***************
*** 910,914 ****
PyErr_Clear();
if (!PyWinObject_AsWriteBuffer(obBuf, &buf, &bufSize,FALSE)){
! PyErr_SetString(PyExc_TypeError, "Second param must be an integer or a buffer object");
return NULL;
}
--- 910,914 ----
PyErr_Clear();
if (!PyWinObject_AsWriteBuffer(obBuf, &buf, &bufSize,FALSE)){
! PyErr_SetString(PyExc_TypeError, "Second param must be an integer or writeable buffer object");
return NULL;
}
***************
*** 1807,1814 ****
/* If we don't know the address family, don't raise an
exception -- return it as a tuple. */
! return Py_BuildValue("is#",
! addr->sa_family,
! addr->sa_data,
! sizeof(addr->sa_data));
}
--- 1807,1813 ----
/* If we don't know the address family, don't raise an
exception -- return it as a tuple. */
! return Py_BuildValue("iN",
! addr->sa_family,
! PyString_FromStringAndSize(addr->sa_data,sizeof(addr->sa_data)));
}
|