pywin32-checkins Mailing List for Python for Windows Extensions (Page 17)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2009-02-16 04:49:55
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10991 Modified Files: setup.py Log Message: * ensure win32ras builds with WINVER set to 0x0500 so it works on win2k. * Install few extra test data files Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** setup.py 8 Feb 2009 19:31:20 -0000 1.101 --- setup.py 16 Feb 2009 04:49:48 -0000 1.102 *************** *** 1466,1470 **** ("win32process", "advapi32 user32", None, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", None), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ win32/src/win32security.i --- 1466,1470 ---- ("win32process", "advapi32 user32", None, 0x0500), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), ! ("win32ras", "rasapi32 user32", None, 0x0500), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ win32/src/win32security.i *************** *** 2080,2084 **** --- 2080,2089 ---- 'win32/scripts/*.py', 'win32/test/*.py', + 'win32/test/win32rcparser/test.rc', + 'win32/test/win32rcparser/test.h', + 'win32/test/win32rcparser/python.ico', + 'win32/test/win32rcparser/python.bmp', 'win32/Demos/*.py', + 'win32/Demos/images/*.bmp', 'com/win32com/readme.htm', # win32com test utility files. |
From: Mark H. <mha...@us...> - 2009-02-16 03:58:23
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4469/test Modified Files: test_win32file.py Log Message: * Handle failure to import win32timezone and use os.urandom on python 2.3 * Make ConnectEx tests 'do the right thing' on Win2k where ConnextEx isn't available. This involved moving the test threads to use the non-blocking AcceptEx to handle that a connection may never arrive. Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** test_win32file.py 15 Feb 2009 00:43:10 -0000 1.32 --- test_win32file.py 16 Feb 2009 03:58:18 -0000 1.33 *************** *** 1,7 **** import unittest ! from pywin32_testutil import str2bytes import win32api, win32file, win32pipe, pywintypes, winerror, win32event import win32con, ntsecuritycon - import win32timezone import sys import os --- 1,6 ---- import unittest ! from pywin32_testutil import str2bytes, TestSkipped, testmain import win32api, win32file, win32pipe, pywintypes, winerror, win32event import win32con, ntsecuritycon import sys import os *************** *** 15,18 **** --- 14,23 ---- try: + import win32timezone + except SyntaxError: + # win32timezone uses decorators and isn't compatible with py2.3 + assert sys.version_info < (2,4) + + try: set except NameError: *************** *** 627,640 **** class TestConnect(unittest.TestCase): def test_connect_with_payload(self): ! def runner(): ! s1 = socket.socket() ! self.addr = ('localhost', random.randint(10000,64000)) ! s1.bind(self.addr) ! s1.listen(1) ! cli, addr = s1.accept() ! self.request = cli.recv(1024) ! cli.send(str2bytes('some expected response')) ! t = threading.Thread(target=runner) t.start() time.sleep(0.1) --- 632,677 ---- class TestConnect(unittest.TestCase): + def connect_thread_runner(self, expect_payload, giveup_event): + # As Windows 2000 doesn't do ConnectEx, we need to use a non-blocking + # accept, as our test connection may never come. May as well use + # AcceptEx for this... + listener = socket.socket() + self.addr = ('localhost', random.randint(10000,64000)) + listener.bind(self.addr) + listener.listen(1) + + # create accept socket + accepter = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + # An overlapped + overlapped = pywintypes.OVERLAPPED() + overlapped.hEvent = win32event.CreateEvent(None, 0, 0, None) + # accept the connection. + if expect_payload: + buf_size = 1024 + else: + # when we don't expect data we must be careful to only pass the + # exact number of bytes for the endpoint data... + buf_size = win32file.CalculateSocketEndPointSize(listener) + + buffer = win32file.AllocateReadBuffer(buf_size) + win32file.AcceptEx(listener, accepter, buffer, overlapped) + # wait for the connection or our test to fail. + events = giveup_event, overlapped.hEvent + rc = win32event.WaitForMultipleObjects(events, False, 2000) + if rc == win32event.WAIT_TIMEOUT: + self.fail("timed out waiting for a connection") + if rc == win32event.WAIT_OBJECT_0: + # Our main thread running the test failed and will never connect. + return + # must be a connection. + nbytes = win32file.GetOverlappedResult(listener.fileno(), overlapped, False) + if expect_payload: + self.request = buffer[:nbytes] + accepter.send(str2bytes('some expected response')) + def test_connect_with_payload(self): ! giveup_event = win32event.CreateEvent(None, 0, 0, None) ! t = threading.Thread(target=self.connect_thread_runner, ! args=(True, giveup_event)) t.start() time.sleep(0.1) *************** *** 642,646 **** ol = pywintypes.OVERLAPPED() s2.bind(('0.0.0.0', 0)) # connectex requires the socket be bound beforehand ! win32file.ConnectEx(s2, self.addr, ol, str2bytes("some expected request")) win32file.GetOverlappedResult(s2.fileno(), ol, 1) ol = pywintypes.OVERLAPPED() --- 679,689 ---- ol = pywintypes.OVERLAPPED() s2.bind(('0.0.0.0', 0)) # connectex requires the socket be bound beforehand ! try: ! win32file.ConnectEx(s2, self.addr, ol, str2bytes("some expected request")) ! except win32file.error, exc: ! win32event.SetEvent(giveup_event) ! if exc.winerror == 10022: # WSAEINVAL ! raise TestSkipped("ConnectEx is not available on this platform") ! raise # some error error we don't expect. win32file.GetOverlappedResult(s2.fileno(), ol, 1) ol = pywintypes.OVERLAPPED() *************** *** 655,666 **** def test_connect_without_payload(self): ! def runner(): ! s1 = socket.socket() ! self.addr = ('localhost', random.randint(10000,64000)) ! s1.bind(self.addr) ! s1.listen(1) ! cli, addr = s1.accept() ! cli.send(str2bytes('some expected response')) ! t = threading.Thread(target=runner) t.start() time.sleep(0.1) --- 698,704 ---- def test_connect_without_payload(self): ! giveup_event = win32event.CreateEvent(None, 0, 0, None) ! t = threading.Thread(target=self.connect_thread_runner, ! args=(False, giveup_event)) t.start() time.sleep(0.1) *************** *** 668,672 **** ol = pywintypes.OVERLAPPED() s2.bind(('0.0.0.0', 0)) # connectex requires the socket be bound beforehand ! win32file.ConnectEx(s2, self.addr, ol) win32file.GetOverlappedResult(s2.fileno(), ol, 1) ol = pywintypes.OVERLAPPED() --- 706,716 ---- ol = pywintypes.OVERLAPPED() s2.bind(('0.0.0.0', 0)) # connectex requires the socket be bound beforehand ! try: ! win32file.ConnectEx(s2, self.addr, ol) ! except win32file.error, exc: ! win32event.SetEvent(giveup_event) ! if exc.winerror == 10022: # WSAEINVAL ! raise TestSkipped("ConnectEx is not available on this platform") ! raise # some error error we don't expect. win32file.GetOverlappedResult(s2.fileno(), ol, 1) ol = pywintypes.OVERLAPPED() *************** *** 682,686 **** def test_transmit(self): import binascii ! val = binascii.hexlify(os.urandom(1024*1024)) val_length = len(val) f = tempfile.TemporaryFile() --- 726,735 ---- def test_transmit(self): import binascii ! try: ! bytes = os.urandom(1024*1024) ! except AttributeError: ! # must be py2.3... ! bytes = ''.join([chr(random.randint(0,255)) for _ in range(5)]) ! val = binascii.hexlify(bytes) val_length = len(val) f = tempfile.TemporaryFile() *************** *** 746,748 **** if __name__ == '__main__': ! unittest.main() --- 795,797 ---- if __name__ == '__main__': ! testmain() |
From: Mark H. <mha...@us...> - 2009-02-16 03:56:32
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4284/src Modified Files: win32file.i Log Message: * Fix vc6 build error. * autoduck clarifications for ConnectEx and AcceptEx * Add new CalculateSocketEndPointSize() method so AcceptEx can be invoked without attempting to read from the connection. Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** win32file.i 15 Feb 2009 23:49:10 -0000 1.106 --- win32file.i 16 Feb 2009 03:56:25 -0000 1.107 *************** *** 41,44 **** --- 41,48 ---- #endif #include "Ws2tcpip.h" + // *sob* - msvc6 can't handle the _WSPIAPI_COUNTOF in later SDKs... + #if _MSC_VER < 1300 + #define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0])) + #endif #include "Wspiapi.h" // for WspiapiGetAddrInfo/WspiapiFreeAddrInfo #endif *************** *** 1774,1778 **** // ConnectEx(sock, (addr, port), buf, overlap) // @rdesc Returns the completion code and number of bytes sent. ! // The error code will be 0 for a completed operation, or ERROR_IO_PENDING for a pending overlapped operation. static PyObject *py_ConnectEx( PyObject *self, PyObject *args, PyObject *kwargs ) { OVERLAPPED *pOverlapped = NULL; --- 1778,1785 ---- // ConnectEx(sock, (addr, port), buf, overlap) // @rdesc Returns the completion code and number of bytes sent. ! // The completion code will be 0 for a completed operation, or ERROR_IO_PENDING for a pending overlapped operation. ! // @rdesc If the platform does not support ConnectEx (eg, Windows 2000), an ! // exception will be thrown indicating the WSAIoctl function (which is used to ! // fetch the function pointer) failed with error code WSAEINVAL (10022). static PyObject *py_ConnectEx( PyObject *self, PyObject *args, PyObject *kwargs ) { OVERLAPPED *pOverlapped = NULL; *************** *** 1943,1949 **** // @comm In order to make sure the connection has been accepted, either use the hEvent in PyOVERLAPPED, GetOverlappedResult, or GetQueuedCompletionStatus. // @comm To use this with I/O completion ports, don't forget to attach sAccepting to your completion port. ! // @comm To have sAccepting inherit the properties of sListening, you need to do the following after a connection is successfully accepted: ! // @comm import struct ! // @comm sAccepting.setsockopt(socket.SOL_SOCKET, win32file.SO_UPDATE_ACCEPT_CONTEXT, struct.pack("I", sListening.fileno())) if (!PySocket_AsSOCKET(obListening, &sListening)) --- 1950,1958 ---- // @comm In order to make sure the connection has been accepted, either use the hEvent in PyOVERLAPPED, GetOverlappedResult, or GetQueuedCompletionStatus. // @comm To use this with I/O completion ports, don't forget to attach sAccepting to your completion port. ! // @ex To have sAccepting inherit the properties of sListening, you need to do the following after a connection is successfully accepted| ! // import struct ! // sAccepting.setsockopt(socket.SOL_SOCKET, win32file.SO_UPDATE_ACCEPT_CONTEXT, struct.pack("I", sListening.fileno())) ! // @comm Pass a buffer of exactly the size returned by <om win32file.CalculateSocketEndPointSize> ! // to have AcceptEx return without reading any bytes from the remote connection. if (!PySocket_AsSOCKET(obListening, &sListening)) *************** *** 2057,2062 **** --- 2066,2107 ---- } + // @pyswig int|CalculateSocketEndPointSize|Calculate how many bytes are needed for the connection endpoints data for a socket. + PyObject *MyCalculateSocketEndPointSize(PyObject *self, PyObject *args) + { + // @comm This function allows you to determine the minumum buffer size + // which can be passed to <om win32file.AcceptEx> + PyObject *obs; + // @pyparm <o PySocket>/int|socket||The socket for which to determine the size. + if (!PyArg_ParseTuple(args, "O", &obs)) + return NULL; + SOCKET s; + if (!PySocket_AsSOCKET(obs, &s)) + return NULL; + + WSAPROTOCOL_INFO wsProtInfo; + UINT cbSize = sizeof(wsProtInfo); + int rc; + + // Grab the protocol information for the socket + Py_BEGIN_ALLOW_THREADS + rc = getsockopt( + s, + SOL_SOCKET, + SO_PROTOCOL_INFO, + (char *)&wsProtInfo, + (int *)&cbSize); + Py_END_ALLOW_THREADS + if (rc == SOCKET_ERROR) + { + PyWin_SetAPIError("getsockopt", WSAGetLastError()); + return NULL; + } + return PyInt_FromLong((wsProtInfo.iMaxSockAddr + 16) * 2); + } + %} + %native(CalculateSocketEndPointSize) MyCalculateSocketEndPointSize; + %{ // @pyswig (iFamily, <o LocalSockAddr>, <o RemoteSockAddr>)|GetAcceptExSockaddrs|Parses the connection endpoints from the buffer passed into AcceptEx PyObject *MyGetAcceptExSockaddrs |
From: Mark H. <mha...@us...> - 2009-02-15 23:51:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9937/src Modified Files: win32inet.i Log Message: fix InternetGetCookie failures when UNICODE is defined on win2k Index: win32inet.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32inet.i,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32inet.i 8 Dec 2008 13:14:24 -0000 1.11 --- win32inet.i 15 Feb 2009 23:51:20 -0000 1.12 *************** *** 371,375 **** PyObject *ret = NULL; BOOL ok = FALSE; ! DWORD cb = 0; TCHAR *buf=NULL, *szUrl = NULL, *szCookieName = NULL; if (!PyArg_ParseTuple(args, "OO:InternetGetCookie", --- 371,375 ---- PyObject *ret = NULL; BOOL ok = FALSE; ! DWORD cch, cchallocated = 0; TCHAR *buf=NULL, *szUrl = NULL, *szCookieName = NULL; if (!PyArg_ParseTuple(args, "OO:InternetGetCookie", *************** *** 381,404 **** if (!PyWinObject_AsTCHAR(obCookieName, &szCookieName, TRUE)) goto done; ! InternetGetCookie(szUrl, szCookieName, NULL, &cb); ! if (!cb) { // assume this means some other failure. PyWin_SetAPIError("InternetGetCookie"); goto done; } ! // cb includes the NULL - Python adds one for the null. ! buf = (TCHAR *)malloc(cb * sizeof(TCHAR)); if (buf==NULL){ PyErr_NoMemory(); goto done; } Py_BEGIN_ALLOW_THREADS ! ok = InternetGetCookie(szUrl, szCookieName, buf, &cb); Py_END_ALLOW_THREADS if (!ok) PyWin_SetAPIError("InternetGetCookie"); ! else ! ret=PyWinObject_FromTCHAR(buf, cb-1); done: ! if (buf) free(buf); if (szUrl) PyWinObject_FreeTCHAR(szUrl); if (szCookieName) PyWinObject_FreeTCHAR(szCookieName); --- 381,421 ---- if (!PyWinObject_AsTCHAR(obCookieName, &szCookieName, TRUE)) goto done; ! InternetGetCookie(szUrl, szCookieName, NULL, &cchallocated); ! if (!cchallocated) { // assume this means some other failure. PyWin_SetAPIError("InternetGetCookie"); goto done; } ! // Note: the docs for InternetGetCookie appear to lie: when NULL is passed ! // you get back the number of *bytes* needed, not TCHARs - however, if ! // NULL is not passed, you do get TCHARs back. In other words, if UNICODE ! // is defined, 'cchallocated' is double the value we get back for 'cch' in ! // our next call which actually gets the data. However - we don't rely on ! // this behaviour - it just means we actually end up allocating double the ! // buffer we need. ! // The number of chars theoretically includes the \0 - but see below. ! buf = (TCHAR *)malloc(cchallocated * sizeof(TCHAR)); if (buf==NULL){ PyErr_NoMemory(); goto done; } + cch = cchallocated; Py_BEGIN_ALLOW_THREADS ! ok = InternetGetCookie(szUrl, szCookieName, buf, &cch); Py_END_ALLOW_THREADS if (!ok) PyWin_SetAPIError("InternetGetCookie"); ! else { ! // Note that on win2k only, and only when UNICODE is defined, we ! // see 'cch' be one less than we expect - ie, it is the number of ! // chars *not* including the NULL. ! #ifdef UNICODE ! if (LOBYTE(LOWORD(GetVersion())) <= 5 && cch && cch < cchallocated && ! buf[cch-1] != _T('\0')) ! cch += 1; ! #endif ! ret=PyWinObject_FromTCHAR(buf, cch-1); ! } done: ! if (buf) free(buf); if (szUrl) PyWinObject_FreeTCHAR(szUrl); if (szCookieName) PyWinObject_FreeTCHAR(szCookieName); |
From: Mark H. <mha...@us...> - 2009-02-15 23:51:26
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9937/test Modified Files: test_win32inet.py Log Message: fix InternetGetCookie failures when UNICODE is defined on win2k Index: test_win32inet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32inet.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_win32inet.py 7 Jan 2009 06:03:29 -0000 1.3 --- test_win32inet.py 15 Feb 2009 23:51:20 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- from win32inet import * from win32inetcon import * + import winerror from pywin32_testutil import str2bytes # py3k-friendly helper *************** *** 12,15 **** --- 13,23 ---- self.assertEqual(got, data) + def testCookiesEmpty(self): + try: + InternetGetCookie("http://site-with-no-cookie.python.org", None) + self.fail("expected win32 exception") + except error, exc: + self.failUnlessEqual(exc.winerror, winerror.ERROR_NO_MORE_ITEMS) + class UrlTests(unittest.TestCase): def testSimpleCanonicalize(self): |
From: Mark H. <mha...@us...> - 2009-02-15 23:49:16
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9779/src Modified Files: win32file.i Log Message: Use Wspiapi.h get/freeaddrinfo api so we can be imported on win2k Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** win32file.i 8 Feb 2009 15:51:42 -0000 1.105 --- win32file.i 15 Feb 2009 23:49:10 -0000 1.106 *************** *** 41,44 **** --- 41,45 ---- #endif #include "Ws2tcpip.h" + #include "Wspiapi.h" // for WspiapiGetAddrInfo/WspiapiFreeAddrInfo #endif *************** *** 1868,1872 **** hints.ai_socktype = prot_info.iSocketType; hints.ai_protocol = prot_info.iProtocol; ! error = getaddrinfo(hptr, pptr, &hints, &res); if (error) { --- 1869,1873 ---- hints.ai_socktype = prot_info.iSocketType; hints.ai_protocol = prot_info.iProtocol; ! error = WspiapiGetAddrInfo(hptr, pptr, &hints, &res); if (error) { *************** *** 1878,1882 **** if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) { ! freeaddrinfo(res); return NULL; } --- 1879,1883 ---- if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) { ! WspiapiFreeAddrInfo(res); return NULL; } *************** *** 1887,1891 **** rc=WSAGetLastError(); Py_END_ALLOW_THREADS; ! freeaddrinfo(res); if (rc==0 || rc == ERROR_IO_PENDING) return Py_BuildValue("ii", rc, sent); --- 1888,1892 ---- rc=WSAGetLastError(); Py_END_ALLOW_THREADS; ! WspiapiFreeAddrInfo(res); if (rc==0 || rc == ERROR_IO_PENDING) return Py_BuildValue("ii", rc, sent); |
From: Mark H. <mha...@us...> - 2009-02-15 01:08:10
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3239 Modified Files: PyWinTypes.h Log Message: python 3.0.1 means we need to add a define for PyNumber_Int Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** PyWinTypes.h 8 Feb 2009 10:11:11 -0000 1.69 --- PyWinTypes.h 15 Feb 2009 01:07:56 -0000 1.70 *************** *** 153,156 **** --- 153,157 ---- #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyNumber_Int PyNumber_Long #endif // (PY_VERSION_HEX < 0x03000000) |
From: Mark H. <mha...@us...> - 2009-02-15 00:43:16
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv357/test Modified Files: test_win32file.py Log Message: Move overlapped objects to rich comparisons to avoid py3.0.1 warnings. Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** test_win32file.py 9 Feb 2009 12:42:15 -0000 1.31 --- test_win32file.py 15 Feb 2009 00:43:10 -0000 1.32 *************** *** 355,358 **** --- 355,381 ---- d = {} d[overlapped] = "hello" + self.failUnlessEqual(d[overlapped], "hello") + + def testComparable(self): + overlapped = pywintypes.OVERLAPPED() + self.failUnlessEqual(overlapped, overlapped) + # ensure we explicitly test the operators. + self.failUnless(overlapped == overlapped) + self.failIf(overlapped != overlapped) + + def testComparable2(self): + # 2 overlapped objects compare equal if their contents are the same. + overlapped1 = pywintypes.OVERLAPPED() + overlapped2 = pywintypes.OVERLAPPED() + self.failUnlessEqual(overlapped1, overlapped2) + # ensure we explicitly test the operators. + self.failUnless(overlapped1 == overlapped2) + self.failIf(overlapped1 != overlapped2) + # now change something in one of them - should no longer be equal. + overlapped1.hEvent = 1 + self.failIfEqual(overlapped1, overlapped2) + # ensure we explicitly test the operators. + self.failIf(overlapped1 == overlapped2) + self.failUnless(overlapped1 != overlapped2) class TestSocketExtensions(unittest.TestCase): |
From: Mark H. <mha...@us...> - 2009-02-15 00:43:15
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv357/src Modified Files: PyOVERLAPPED.cpp PyWinObjects.h Log Message: Move overlapped objects to rich comparisons to avoid py3.0.1 warnings. Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PyWinObjects.h 8 Feb 2009 09:57:09 -0000 1.21 --- PyWinObjects.h 15 Feb 2009 00:43:10 -0000 1.22 *************** *** 103,110 **** /* Python support */ - int compare(PyObject *ob); - static void deallocFunc(PyObject *ob); ! static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *getattro(PyObject *self, PyObject *obname); --- 103,108 ---- /* Python support */ static void deallocFunc(PyObject *ob); ! static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static PyObject *getattro(PyObject *self, PyObject *obname); Index: PyOVERLAPPED.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PyOVERLAPPED.cpp 11 Dec 2008 00:25:40 -0000 1.16 --- PyOVERLAPPED.cpp 15 Feb 2009 00:43:10 -0000 1.17 *************** *** 72,77 **** 0, /* tp_getattr */ 0, /* tp_setattr */ ! // @pymeth __cmp__|Used when OVERLAPPED objects are compared. ! PyOVERLAPPED::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ --- 72,76 ---- 0, /* tp_getattr */ 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ *************** *** 88,92 **** 0, /* tp_traverse */ 0, /* tp_clear */ ! 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ --- 87,91 ---- 0, /* tp_traverse */ 0, /* tp_clear */ ! PyOVERLAPPED::richcompareFunc, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ *************** *** 147,159 **** } ! int PyOVERLAPPED::compare(PyObject *ob) ! { ! return memcmp(&m_overlapped, &((PyOVERLAPPED *)ob)->m_overlapped, sizeof(m_overlapped)); ! } ! ! // @pymethod int|PyOVERLAPPED|__cmp__|Used when objects are compared. ! int PyOVERLAPPED::compareFunc(PyObject *ob1, PyObject *ob2) { ! return ((PyOVERLAPPED *)ob1)->compare(ob2); } --- 146,169 ---- } ! PyObject *PyOVERLAPPED::richcompareFunc(PyObject *ob, PyObject *other, int op) { ! PyOVERLAPPED::sMyOverlapped *mine = &((PyOVERLAPPED *)ob)->m_overlapped; ! PyOVERLAPPED::sMyOverlapped *oother; ! if (PyOVERLAPPED_Check(other)) { ! oother = &((PyOVERLAPPED *)other)->m_overlapped; ! } else { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } ! BOOL e = memcmp(mine, oother, sizeof(*mine))==0; ! PyObject *ret; ! if (op==Py_EQ) ! ret = e ? Py_True : Py_False; ! else if (op==Py_NE) ! ret = !e ? Py_True : Py_False; ! else ! ret = Py_NotImplemented; ! Py_INCREF(ret); ! return ret; } |
From: Mark H. <mha...@us...> - 2009-02-14 23:04:59
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21846 Modified Files: MANIFEST.in Log Message: tweaks to the manifest so the source zip is created correctly. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pywin32/pywin32/MANIFEST.in,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MANIFEST.in 24 May 2008 08:02:41 -0000 1.14 --- MANIFEST.in 14 Feb 2009 23:04:55 -0000 1.15 *************** *** 6,12 **** include MANIFEST.in include pywin32.pth - # while we have setup.py and setup_win32all.py, distutils will miss whatever - # one was not used! - include setup_win32all.py include setup.py include pywin32_postinstall.py --- 6,9 ---- *************** *** 23,27 **** include win32/src/*.manifest include win32/src/PerfMon/perfmondata.def - include win32/src/dbi.def include win32/*.dsp include win32/License.txt --- 20,23 ---- *************** *** 33,36 **** --- 29,40 ---- include com/win32com/HTML/*.html include com/win32com/HTML/image/*.gif + include com/win32com/test/*.idl + include com/win32com/test/*.js + include com/win32com/test/*.sct + include com/win32com/test/*.tlb + include com/win32com/test/*.txt + include com/win32com/test/*.vbs + include com/win32com/test/*.xsl + include com/License.txt include com/*.dsp |
From: Vernon C. <kf...@us...> - 2009-02-14 15:13:58
|
Update of /cvsroot/pywin32/pywin32/adodbapi/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3331 Modified Files: adodbapitest.py adodbapitestconfig.py Log Message: Test of Python time converter weakened. Works in all time zones now. Index: adodbapitest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitest.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** adodbapitest.py 6 Feb 2009 03:35:11 -0000 1.9 --- adodbapitest.py 14 Feb 2009 15:13:52 -0000 1.10 *************** *** 1,3 **** ! """ Unit tests for adodbapi version 2.2.6""" """ adodbapi - A python DB API 2.0 interface to Microsoft ADO --- 1,3 ---- ! """ Unit tests for adodbapi version 2.2.6 (d)""" """ adodbapi - A python DB API 2.0 interface to Microsoft ADO *************** *** 671,676 **** def testDateObjectFromCOMDate(self): cmd=self.tc.DateObjectFromCOMDate(37435.7604282) ! t1=time.gmtime(time.mktime((2002,6,28,12,14,1, 4,31+28+31+30+31+28,-1))) ! t2=time.gmtime(time.mktime((2002,6,28,12,16,1, 4,31+28+31+30+31+28,-1))) assert t1<cmd<t2, '"%s" should be about 2002-6-28 12:15:01'%repr(cmd) --- 671,677 ---- def testDateObjectFromCOMDate(self): cmd=self.tc.DateObjectFromCOMDate(37435.7604282) ! t1=time.gmtime(time.mktime((2002,6,28,0,14,1, 4,31+28+31+30+31+28,-1))) ! #there are errors in the implementation of gmtime which we ignore ! t2=time.gmtime(time.mktime((2002,6,29,12,14,2, 4,31+28+31+30+31+28,-1))) assert t1<cmd<t2, '"%s" should be about 2002-6-28 12:15:01'%repr(cmd) Index: adodbapitestconfig.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitestconfig.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** adodbapitestconfig.py 2 Feb 2009 03:48:41 -0000 1.7 --- adodbapitestconfig.py 14 Feb 2009 15:13:52 -0000 1.8 *************** *** 1,4 **** # Configure this in order to run the testcases. ! "adodbapitestconfig.py v 2.2.5" import os --- 1,4 ---- # Configure this in order to run the testcases. ! "adodbapitestconfig.py v 2.2.6" import os *************** *** 36,40 **** _accessdatasource = None #set to None for automatic creation #r"C:\Program Files\Microsoft Office\Office\Samples\northwind.mdb;" - #Typically C:\Program Files if _accessdatasource == None: # following setup code borrowed from pywin32 odbc test suite --- 36,39 ---- *************** *** 80,84 **** if doSqlServerTest: ! _computername=".\SQLEXPRESS" #or name of computer with SQL Server _databasename="Northwind" #or something else #_username="guest" --- 79,83 ---- if doSqlServerTest: ! _computername=r".\SQLEXPRESS" #or name of computer with SQL Server _databasename="Northwind" #or something else #_username="guest" |
From: Vernon C. <kf...@us...> - 2009-02-14 15:13:07
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3250 Modified Files: readme.txt Log Message: Test for python time converter weakened. Works in all time zones now. Index: readme.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/readme.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** readme.txt 6 Feb 2009 03:35:11 -0000 1.8 --- readme.txt 14 Feb 2009 15:12:59 -0000 1.9 *************** *** 27,42 **** you can select other options by the user defined convertion feature. Try: ! adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtString or: ! adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtFloat or: ! adodbapi.variantConversions[adodbapi.adNumeric] = write_your_own_convertion_function ............ Whats new in version 2.2.6 1. Actually works in Python 3.0 (using pywin32 212.6) after running thru 2to3 2. RESTRICTION: Python Time (as opposed to datetime.datetime, which is the default) may return ! incorrect results. We believe this happens when used with Southern Hemisphere time zones. ! To avoid this problem, do not use adodbapi.pythonTimeConverter. ! 3. Several improvements in the test routines, including alteration of dbapi20 for Python 3.0 compatibility. (Some requirements of PEP249 are incompatible with Python 3.0) --- 27,42 ---- you can select other options by the user defined convertion feature. Try: ! adodbapi.adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.adodbapi.cvtString or: ! adodbapi.adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.adodbapi.cvtFloat or: ! adodbapi.adodbapi.variantConversions[adodbapi.adNumeric] = write_your_own_convertion_function ............ Whats new in version 2.2.6 1. Actually works in Python 3.0 (using pywin32 212.6) after running thru 2to3 2. RESTRICTION: Python Time (as opposed to datetime.datetime, which is the default) may return ! incorrect results. To avoid this problem, do not use adodbapi.pythonTimeConverter. ! 3. The python time converter test has been loosened so that it will pass in any time zone. ! 4. Several improvements in the test routines, including alteration of dbapi20 for Python 3.0 compatibility. (Some requirements of PEP249 are incompatible with Python 3.0) |
From: Roger U. <ru...@us...> - 2009-02-13 23:05:45
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6507 Modified Files: test_clipboard.py Log Message: Fix TestBitmap Index: test_clipboard.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_clipboard.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_clipboard.py 7 Jan 2009 06:03:29 -0000 1.8 --- test_clipboard.py 13 Feb 2009 22:13:11 -0000 1.9 *************** *** 33,37 **** except NameError: this_file = sys.argv[0] ! this_dir = os.path.dirname(__file__) self.bmp_name = os.path.join(os.path.abspath(this_dir), "..", "Demos", "images", "smiley.bmp") --- 33,37 ---- except NameError: this_file = sys.argv[0] ! this_dir = os.path.dirname(this_file) self.bmp_name = os.path.join(os.path.abspath(this_dir), "..", "Demos", "images", "smiley.bmp") |
From: Roger U. <ru...@us...> - 2009-02-11 02:46:59
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3041 Modified Files: find.py Log Message: Use None for extended style Index: find.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/find.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** find.py 31 Jan 2009 03:07:25 -0000 1.13 --- find.py 11 Feb 2009 02:46:50 -0000 1.14 *************** *** 218,222 **** visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Find", (0, 2, 240, 75), style, 0, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], --- 218,222 ---- visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Find", (0, 2, 240, 75), style, None, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], |
From: Roger U. <ru...@us...> - 2009-02-10 14:33:25
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17869 Modified Files: win32apimodule.cpp Log Message: Use "h" format for SYSTEMTIME elements Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** win32apimodule.cpp 2 Feb 2009 17:25:49 -0000 1.98 --- win32apimodule.cpp 10 Feb 2009 14:33:21 -0000 1.99 *************** *** 112,116 **** PyObject *PyTuple_FromSYSTEMTIME(SYSTEMTIME &st) { ! return Py_BuildValue("iiiiiiii", st.wYear, st.wMonth, --- 112,116 ---- PyObject *PyTuple_FromSYSTEMTIME(SYSTEMTIME &st) { ! return Py_BuildValue("hhhhhhhh", st.wYear, st.wMonth, *************** *** 125,129 **** BOOL PyTuple_AsSYSTEMTIME(PyObject *ob, SYSTEMTIME &st) { ! return PyArg_ParseTuple(ob, "iiiiiiii", &st.wYear, &st.wMonth, --- 125,129 ---- BOOL PyTuple_AsSYSTEMTIME(PyObject *ob, SYSTEMTIME &st) { ! return PyArg_ParseTuple(ob, "hhhhhhhh", &st.wYear, &st.wMonth, *************** *** 5029,5033 **** GetSystemTime(&t); PyW32_END_ALLOW_THREADS; ! return Py_BuildValue ("(iiiiiiii)", t.wYear, t.wMonth, --- 5029,5033 ---- GetSystemTime(&t); PyW32_END_ALLOW_THREADS; ! return Py_BuildValue ("(hhhhhhhh)", t.wYear, t.wMonth, *************** *** 5052,5056 **** // GetLocalTime is a void function GetLocalTime(&t); ! return Py_BuildValue ("(iiiiiiii)", t.wYear, t.wMonth, --- 5052,5056 ---- // GetLocalTime is a void function GetLocalTime(&t); ! return Py_BuildValue ("(hhhhhhhh)", t.wYear, t.wMonth, |
From: Mark H. <mha...@us...> - 2009-02-10 11:21:24
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18254 Modified Files: CHANGES.txt Log Message: win32eventlog.OpenEventLog and OpenBackupEventLog now return a PyHANDLE object which auto-closes on destruction. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** CHANGES.txt 4 Feb 2009 02:34:24 -0000 1.45 --- CHANGES.txt 10 Feb 2009 11:21:18 -0000 1.46 *************** *** 22,25 **** --- 22,28 ---- - Vernon Cole: for help with porting adodbapi to py3k. + * win32eventlog.OpenEventLog and OpenBackupEventLog now return a PyHANDLE + object which auto-closes on destruction. + * pythoncom servers which implemented 'universal' vtable interfaces from a typelib could cause Data Execution Protection (DEP) to be triggered if |
From: Mark H. <mha...@us...> - 2009-02-10 11:21:23
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18254/win32/src Modified Files: win32evtlog.i Log Message: win32eventlog.OpenEventLog and OpenBackupEventLog now return a PyHANDLE object which auto-closes on destruction. Index: win32evtlog.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32evtlog.i,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32evtlog.i 8 Jan 2009 02:56:18 -0000 1.9 --- win32evtlog.i 10 Feb 2009 11:21:18 -0000 1.10 *************** *** 11,14 **** --- 11,67 ---- #include <structmember.h> + #undef PyHANDLE + #include "PyWinObjects.h" + + // @object PyEVTLOG_HANDLE|Object representing a handle to the windows event log. + // Identical to <o PyHANDLE>, but calls CloseEventLog() on destruction + class PyEVTLOG_HANDLE: public PyHANDLE + { + public: + PyEVTLOG_HANDLE(HANDLE hInit) : PyHANDLE(hInit) {} + virtual BOOL Close(void) { + BOOL ok = m_handle ? CloseEventLog(m_handle) : TRUE; + m_handle = 0; + if (!ok) + PyWin_SetAPIError("CloseEventLog"); + return ok; + } + virtual const char *GetTypeName() { + return "PyEVTLOG_HANDLE"; + } + }; + #define PyHANDLE HANDLE + + PyObject *PyWinObject_FromEVTLOG_HANDLE(HANDLE h) + { + PyObject *ret = new PyEVTLOG_HANDLE(h); + if (!ret) + PyErr_NoMemory(); + return ret; + } + + %} + + %typemap(python,except) PyEVTLOG_HANDLE { + Py_BEGIN_ALLOW_THREADS + $function + Py_END_ALLOW_THREADS + if ($source==0 || $source==INVALID_HANDLE_VALUE) { + $cleanup + return PyWin_SetAPIError("$name"); + } + } + + %typemap(python,out) PyEVTLOG_HANDLE { + $target = PyWinObject_FromEVTLOG_HANDLE($source); + } + + typedef HANDLE PyEVTLOG_HANDLE; + %{ + #define PyEVTLOG_HANDLE HANDLE + %} + + %{ + // @object PyEventLogRecord|An object containing the data in an EVENTLOGRECORD. class PyEventLogRecord : public PyObject *************** *** 343,348 **** ); ! // @pyswig int|OpenEventLog|Opens an event log. ! %name (OpenEventLog) HANDLE OpenEventLogW ( WCHAR *INPUT_NULLOK, // @pyparm <o PyUnicode>|serverName||The server name, or None WCHAR *sourceName // @pyparm <o PyUnicode>|sourceName||specifies the name of the source that the returned handle will reference. The source name must be a subkey of a logfile entry under the EventLog key in the registry. --- 396,401 ---- ); ! // @pyswig <o PyEVTLOG_HANDLE>|OpenEventLog|Opens an event log. ! %name (OpenEventLog) PyEVTLOG_HANDLE OpenEventLogW ( WCHAR *INPUT_NULLOK, // @pyparm <o PyUnicode>|serverName||The server name, or None WCHAR *sourceName // @pyparm <o PyUnicode>|sourceName||specifies the name of the source that the returned handle will reference. The source name must be a subkey of a logfile entry under the EventLog key in the registry. *************** *** 357,361 **** ! // @pyswig int|OpenBackupEventLog|Opens a previously saved event log. %name (OpenBackupEventLog) HANDLE OpenBackupEventLogW ( WCHAR *INPUT_NULLOK, // @pyparm <o PyUnicode>|serverName||The server name, or None --- 410,414 ---- ! // @pyswig <o PyEVTLOG_HANDLE>|OpenBackupEventLog|Opens a previously saved event log. %name (OpenBackupEventLog) HANDLE OpenBackupEventLogW ( WCHAR *INPUT_NULLOK, // @pyparm <o PyUnicode>|serverName||The server name, or None |
From: Mark H. <mha...@us...> - 2009-02-10 11:19:14
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16808/win32/Lib Modified Files: win32evtlogutil.py Log Message: LoadLibrary with LOAD_LIBRARY_AS_DATAFILE instead of DONT_RESOLVE_DLL_REFERENCES to prevent issues formatting some eventlog messages. Index: win32evtlogutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32evtlogutil.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32evtlogutil.py 11 Dec 2008 05:13:07 -0000 1.12 --- win32evtlogutil.py 10 Feb 2009 11:19:06 -0000 1.13 *************** *** 2,6 **** """ ! import win32api, win32con, winerror, win32evtlog, string error = win32api.error # The error the evtlog module raises. --- 2,6 ---- """ ! import win32api, win32con, winerror, win32evtlog error = win32api.error # The error the evtlog module raises. *************** *** 110,114 **** dllName = win32api.ExpandEnvironmentStrings(dllName) ! dllHandle = win32api.LoadLibraryEx(dllName, 0, win32con.DONT_RESOLVE_DLL_REFERENCES) try: data = win32api.FormatMessageW(win32con.FORMAT_MESSAGE_FROM_HMODULE, --- 110,114 ---- dllName = win32api.ExpandEnvironmentStrings(dllName) ! dllHandle = win32api.LoadLibraryEx(dllName, 0, win32con.LOAD_LIBRARY_AS_DATAFILE) try: data = win32api.FormatMessageW(win32con.FORMAT_MESSAGE_FROM_HMODULE, |
From: Mark H. <mha...@us...> - 2009-02-10 11:17:00
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15967/win32/Demos Modified Files: eventLogDemo.py Log Message: pretty demo output and catch unicode errors printing the record Index: eventLogDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/eventLogDemo.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** eventLogDemo.py 7 Jan 2009 06:03:29 -0000 1.8 --- eventLogDemo.py 10 Feb 2009 11:16:57 -0000 1.9 *************** *** 30,36 **** user_desc = None if dumpEachRecord: if user_desc: print user_desc ! print msg num = num + len(objects) --- 30,42 ---- user_desc = None if dumpEachRecord: + print "Event record from %r generated at %s" % (object.SourceName, object.TimeGenerated.Format()) if user_desc: print user_desc ! try: ! print msg ! except UnicodeError: ! print "(unicode error printing message: repr() follows...)" ! print repr(msg) ! num = num + len(objects) |
From: Mark H. <mha...@us...> - 2009-02-10 11:16:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15811/com/win32com/client Modified Files: dynamic.py Log Message: use startswith/endswith to prevent errors if someone passes an empty attr Index: dynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dynamic.py 4 Feb 2009 04:01:25 -0000 1.30 --- dynamic.py 10 Feb 2009 11:16:43 -0000 1.31 *************** *** 449,453 **** return Factory(enum) ! if attr[0]=='_' and attr[-1]=='_': # Fast-track. raise AttributeError(attr) # If a known method, create new instance and return. --- 449,453 ---- return Factory(enum) ! if attr.startswith('_') and attr.endswith('_'): # Fast-track. raise AttributeError(attr) # If a known method, create new instance and return. |
From: Mark H. <mha...@us...> - 2009-02-09 13:01:17
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8482/com/win32com/server Modified Files: register.py Log Message: use exception attributes Index: register.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/register.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** register.py 27 Jan 2009 06:25:56 -0000 1.26 --- register.py 9 Feb 2009 13:01:12 -0000 1.27 *************** *** 566,570 **** # ShellExecuteEx with 'runas' verb to force elevation (vista) and/or # admin login dialog (vista/xp) ! if flags['unattended'] or exc[0] != winerror.ERROR_ACCESS_DENIED \ or sys.getwindowsversion()[0] < 5: raise --- 566,570 ---- # ShellExecuteEx with 'runas' verb to force elevation (vista) and/or # admin login dialog (vista/xp) ! if flags['unattended'] or exc.winerror != winerror.ERROR_ACCESS_DENIED \ or sys.getwindowsversion()[0] < 5: raise |
From: Mark H. <mha...@us...> - 2009-02-09 13:00:38
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8298/win32/Demos Modified Files: NetValidatePasswordPolicy.py Log Message: correct usage string and make 'auth' default arg Index: NetValidatePasswordPolicy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/NetValidatePasswordPolicy.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NetValidatePasswordPolicy.py 4 Jun 2008 08:18:55 -0000 1.1 --- NetValidatePasswordPolicy.py 9 Feb 2009 13:00:33 -0000 1.2 *************** *** 33,37 **** def main(): ! parser = optparse.OptionParser("%prog [options] add|change ...", description="A win32net.NetValidatePasswordPolicy demo.") --- 33,37 ---- def main(): ! parser = optparse.OptionParser("%prog [options] auth|change ...", description="A win32net.NetValidatePasswordPolicy demo.") *************** *** 63,67 **** if not args: ! parser.error("You must supply an arg") for arg in args: --- 63,67 ---- if not args: ! args = ["auth"] for arg in args: |
From: Mark H. <mha...@us...> - 2009-02-09 13:00:03
|
Update of /cvsroot/pywin32/pywin32/com/win32com/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8086/com/win32com/demos Modified Files: trybag.py Log Message: IPropertyBag needs a real exception instance Index: trybag.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/trybag.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** trybag.py 27 Nov 2008 09:42:41 -0000 1.2 --- trybag.py 9 Feb 2009 12:59:57 -0000 1.3 *************** *** 17,21 **** if errorLog: hr = 0x80070057 ! errorLog.AddError(propName, (0, "Bag.Read", "no such item", None, 0, hr)) raise exception.Exception(scode=hr) return self.data[propName] --- 17,22 ---- if errorLog: hr = 0x80070057 ! exc = pythoncom.com_error(0, "Bag.Read", "no such item", None, 0, hr) ! errorLog.AddError(propName, exc) raise exception.Exception(scode=hr) return self.data[propName] |
From: Mark H. <mha...@us...> - 2009-02-09 12:42:19
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3902 Modified Files: test_win32file.py Log Message: Add index and slice tests for win32file.AllocateReadBuffer Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** test_win32file.py 26 Jan 2009 01:23:09 -0000 1.30 --- test_win32file.py 9 Feb 2009 12:42:15 -0000 1.31 *************** *** 19,22 **** --- 19,39 ---- from sets import Set as set + class TestReadBuffer(unittest.TestCase): + def testLen(self): + buffer = win32file.AllocateReadBuffer(1) + self.failUnlessEqual(len(buffer), 1) + + def testSimpleIndex(self): + val = str2bytes('\xFF') + buffer = win32file.AllocateReadBuffer(1) + buffer[0] = val + self.failUnlessEqual(buffer[0], val) + + def testSimpleSlice(self): + buffer = win32file.AllocateReadBuffer(2) + val = str2bytes('\0\0') + buffer[:2] = val + self.failUnlessEqual(buffer[0:2], val) + class TestSimpleOps(unittest.TestCase): def testSimpleFiles(self): |
From: Mark H. <mha...@us...> - 2009-02-09 12:41:28
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3684 Modified Files: test_win32gui.py Log Message: add missing import and buffer slice tests Index: test_win32gui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32gui.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_win32gui.py 8 Feb 2009 09:59:19 -0000 1.2 --- test_win32gui.py 9 Feb 2009 12:41:23 -0000 1.3 *************** *** 5,8 **** --- 5,9 ---- import operator import array + import sys # theoretically should be in pywin32_testutil, but this is the only place *************** *** 39,42 **** --- 40,51 ---- got = win32gui.PyGetMemory(addr, buflen) self.failUnlessEqual(got[0], pywin32_testutil.str2bytes('\0')) + + def test_memory_slice(self): + # Check we can slice the buffer object returned by PyGetMemory + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + self.failUnlessEqual(got[0:3], pywin32_testutil.str2bytes('\0\1\2')) def test_real_view(self): |