pywin32-checkins Mailing List for Python for Windows Extensions (Page 19)
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-07 04:29:02
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26073 Modified Files: setup.py Log Message: Get the axdebug extension building on amd64. With lots of help from Steve Yin via [1727357] new VC8.0 build patch for AMD64 branch (inc axdebug) Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** setup.py 3 Feb 2009 00:51:42 -0000 1.99 --- setup.py 7 Feb 2009 04:28:59 -0000 1.100 *************** *** 30,46 **** SDKs, so these fail to build, but the 'mapi' extension should still build. - To build the axdebug extension for 32bit Python, follow these instructions: - - * Download the "Internet Explorer 4.01 Refresh of the Internet Client SDK" - from http://support.microsoft.com/kb/q177877/. - * The download is a self-extracting archive - execute it and unzip the - contents to a 'temp' directory. - * From that directory, copy 'include/axdebug.h' and 'lib/msdbg.lib' to - somewhere the build process will find them - the 'include' and 'lib' - directories of your SDK installation works. - - Note that no equivalent SDK for 64bit operating systems appears available, - so this extension does not build on 64bit versions. - Building: --------- --- 30,33 ---- *************** *** 1634,1641 **** # module for details on getting it built. WinExt_win32com('axdebug', ! libraries="axscript msdbg", pch_header="stdafx.h", - optional_headers=["activdbg.h"], - platforms=['win32'], sources=(""" %(axdebug)s/AXDebug.cpp --- 1621,1626 ---- # module for details on getting it built. WinExt_win32com('axdebug', ! libraries="axscript", pch_header="stdafx.h", sources=(""" %(axdebug)s/AXDebug.cpp |
|
From: Mark H. <mha...@us...> - 2009-02-07 04:26:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25825/com/win32comext/axdebug/src Modified Files: stdafx.cpp Log Message: remove old atl source file reference Index: stdafx.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/stdafx.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stdafx.cpp 1 Sep 1999 23:09:05 -0000 1.1 --- stdafx.cpp 7 Feb 2009 04:26:19 -0000 1.2 *************** *** 2,7 **** #include "stdafx.h" - - #if _ATL_VER >= 0x0200 - # include <atlconv.cpp> - #endif --- 2,3 ---- |
|
From: Mark H. <mha...@us...> - 2009-02-07 04:21:55
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25382 Added Files: activdbg.h Log Message: checkin MIDL generated file which is very hard to find otherwise --- NEW FILE: activdbg.h --- /* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 6.00.0366 */ /* Compiler settings for activdbg.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ //@@MIDL_FILE_HEADING( ) #pragma warning( disable: 4049 ) /* more than 64k source lines */ [...12064 lines suppressed...] /* [out] */ ULONG *pceltFetched); /* [call_as] */ HRESULT __stdcall IEnumDebugExpressionContexts_Next_Stub( IEnumDebugExpressionContexts * This, /* [in] */ ULONG celt, /* [length_is][size_is][out] */ IDebugExpressionContext **pprgdec, /* [out] */ ULONG *pceltFetched); /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif |
|
From: Mark H. <mha...@us...> - 2009-02-07 01:12:11
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28731/win32/Lib Modified Files: win32timezone.py Log Message: remove invalid assertion Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** win32timezone.py 25 Jan 2009 14:46:56 -0000 1.25 --- win32timezone.py 7 Feb 2009 01:12:07 -0000 1.26 *************** *** 474,479 **** "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return - assert dt.tzinfo is self - winInfo = self.getWinInfo(dt.year) if not self.fixedStandardTime and self._inDaylightSavings(dt): --- 474,477 ---- |
|
From: Mark H. <mha...@us...> - 2009-02-07 00:33:13
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21769 Modified Files: pipeTestService.py Log Message: get pipe demo service working in py3k Index: pipeTestService.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestService.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pipeTestService.py 27 Nov 2008 05:58:17 -0000 1.7 --- pipeTestService.py 7 Feb 2009 00:33:06 -0000 1.8 *************** *** 69,73 **** # Create a loop, reading large data. If we knew the data stream was # was small, a simple ReadFile would do. ! d = '' hr = winerror.ERROR_MORE_DATA while hr==winerror.ERROR_MORE_DATA: --- 69,73 ---- # Create a loop, reading large data. If we knew the data stream was # was small, a simple ReadFile would do. ! d = ''.encode('ascii') # ensure bytes on py2k and py3k... hr = winerror.ERROR_MORE_DATA while hr==winerror.ERROR_MORE_DATA: *************** *** 83,87 **** # pipe, but for the sake of this demo we dont (if only to see what errors # we can get when our clients break at strange times :-) ! if ok: WriteFile(pipeHandle,"%s (on thread %d) sent me %s" % (GetNamedPipeHandleState(pipeHandle)[4],tid, d)) finally: ApplyIgnoreError( DisconnectNamedPipe, (pipeHandle,) ) --- 83,89 ---- # pipe, but for the sake of this demo we dont (if only to see what errors # we can get when our clients break at strange times :-) ! if ok: ! msg = ("%s (on thread %d) sent me %s" % (GetNamedPipeHandleState(pipeHandle)[4],tid, d)).encode('ascii') ! WriteFile(pipeHandle, msg) finally: ApplyIgnoreError( DisconnectNamedPipe, (pipeHandle,) ) |
|
From: Mark H. <mha...@us...> - 2009-02-07 00:32:33
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21610 Modified Files: PythonService.cpp Log Message: fix argv handling now we always build as UNICODE Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PythonService.cpp 28 Dec 2008 10:43:45 -0000 1.26 --- PythonService.cpp 7 Feb 2009 00:32:30 -0000 1.27 *************** *** 590,593 **** --- 590,602 ---- } + static char *NarrowString(WCHAR *s) + { + int cchNarrow = WideCharToMultiByte(CP_ACP, 0, s, -1, NULL, 0, NULL, NULL); + char *ret = (char *)malloc(cchNarrow); + if (ret) + WideCharToMultiByte(CP_ACP, 0, s, -1, ret, cchNarrow, NULL, NULL); + return ret; + } + // Couple of helpers for the service manager static void PyService_InitPython() *************** *** 604,614 **** int pyargc; #if (PY_VERSION_HEX < 0x03000000) ! pyargc = __argc; ! char **pyargv = __argv; #else ! WCHAR **pyargv; ! pyargv = CommandLineToArgvW(GetCommandLineW(), &pyargc); #endif ! Py_SetProgramName(pyargv[0]); #ifdef BUILD_FREEZE --- 613,631 ---- int pyargc; #if (PY_VERSION_HEX < 0x03000000) ! pyargc = 0; ! char **pyargv = (char **)malloc(sizeof(char *) * __argc); ! if (pyargv) { ! for (;pyargc<__argc;pyargc++) { ! pyargv[pyargc] = NarrowString(__wargv[pyargc]); ! if (!pyargv[pyargc]) { ! break; ! } ! } ! } #else ! WCHAR **pyargv = CommandLineToArgvW(GetCommandLineW(), &pyargc); #endif ! if (pyargv) ! Py_SetProgramName(pyargv[0]); #ifdef BUILD_FREEZE *************** *** 621,627 **** // Ensure we are set for threading. PyEval_InitThreads(); ! PySys_SetArgv(pyargc, pyargv); #if (PY_VERSION_HEX < 0x03000000) initservicemanager(); #else PyInit_servicemanager(); --- 638,654 ---- // Ensure we are set for threading. PyEval_InitThreads(); ! // Notes about argv: When debugging a service, the argv is currently ! // the *full* args, including the "-debug servicename" args. This ! // isn't ideal, but has been this way for a few builds, and a good ! // fix isn't clear - should 'servicename' be presented in argv, even ! // though it never is when running as a real service? ! if (pyargv) ! PySys_SetArgv(pyargc, pyargv); #if (PY_VERSION_HEX < 0x03000000) initservicemanager(); + // free the argv we created above + for (int i=0;i<pyargc;i++) + free(pyargv[i]); + free(pyargv); #else PyInit_servicemanager(); |
|
From: Roger U. <ru...@us...> - 2009-02-06 16:29:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13633 Modified Files: scriptutils.py Log Message: Fix reload function for Python 2.x Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** scriptutils.py 31 Jan 2009 05:30:16 -0000 1.24 --- scriptutils.py 6 Feb 2009 16:29:06 -0000 1.25 *************** *** 428,435 **** if bNeedReload: try: ! from imp import reload # py3k except ImportError: ! pass # reload a builtin in py2k ! reload(sys.modules[modName]) win32ui.SetStatusText('Successfully ' + what + "ed module '"+modName+"'") except: --- 428,438 ---- if bNeedReload: try: ! ## The interpreter sees this import as a local assignment, so Python 2.x throws ! ## UnboundLocalError: local variable 'reload' referenced before assignment ! ## when you try to use reload after this fails ! from imp import reload as my_reload # py3k except ImportError: ! my_reload = reload # reload a builtin in py2k ! my_reload(sys.modules[modName]) win32ui.SetStatusText('Successfully ' + what + "ed module '"+modName+"'") except: |
|
From: Vernon C. <kf...@us...> - 2009-02-06 03:51:31
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12278 Modified Files: adodbapi.py Log Message: Emend incorrect bug fix. Index: adodbapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/adodbapi.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** adodbapi.py 6 Feb 2009 03:35:11 -0000 1.8 --- adodbapi.py 6 Feb 2009 03:51:25 -0000 1.9 *************** *** 227,231 **** secondsperday=86400 # 24*60*60 #ComDate is number of days since 1899-12-31, gmtime epoch is 1970-1-1 = 25569 days ! t=time.localtime(secondsperday*(fcomDate-25569.0)) return t #year,month,day,hour,minute,second,weekday,julianday,daylightsaving=t --- 227,231 ---- secondsperday=86400 # 24*60*60 #ComDate is number of days since 1899-12-31, gmtime epoch is 1970-1-1 = 25569 days ! t=time.gmtime(secondsperday*(fcomDate-25569.0)) return t #year,month,day,hour,minute,second,weekday,julianday,daylightsaving=t |
|
From: Vernon C. <kf...@us...> - 2009-02-06 03:35:22
|
Update of /cvsroot/pywin32/pywin32/adodbapi/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10319/tests Modified Files: RunTests.bat adodbapitest.py dbapi20.py test_adodbapi_dbapi20.py Log Message: Tested okay with Python 3.0, includes last minute patches from Mark H. Index: adodbapitest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitest.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** adodbapitest.py 2 Feb 2009 03:48:41 -0000 1.8 --- adodbapitest.py 6 Feb 2009 03:35:11 -0000 1.9 *************** *** 44,47 **** --- 44,52 ---- import win32com.decimal_23 as decimal + def str2bytes(sval): + if sys.version_info < (3,0) and isinstance(sval, str): + sval = sval.decode("latin1") + return sval.encode("latin1") + class CommonDBTests(unittest.TestCase): "Self contained super-simple tests in easy syntax, should work on everything between mySQL and Oracle" *************** *** 249,253 **** if self.getEngine() != 'ACCESS': self.helpTestDataType("bit",'NUMBER',1) #Does not work correctly with access ! self.helpTestDataType("bigint",'NUMBER',3000000000L) def testDataTypeChar(self): --- 254,258 ---- if self.getEngine() != 'ACCESS': self.helpTestDataType("bit",'NUMBER',1) #Does not work correctly with access ! self.helpTestDataType("bigint",'NUMBER',3000000000) def testDataTypeChar(self): *************** *** 275,280 **** pass #self.helpTestDataType("BLOB",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) else: ! # python 3.0 syntax -> binfld = b'\x00\x01\xE2\x40' ! binfld = '\x00\x01\xE2\x40' self.helpTestDataType("binary(4)",'BINARY',adodbapi.Binary(binfld)) self.helpTestDataType("varbinary(100)",'BINARY',adodbapi.Binary(binfld)) --- 280,284 ---- pass #self.helpTestDataType("BLOB",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) else: ! binfld = str2bytes('\x00\x01\xE2\x40') self.helpTestDataType("binary(4)",'BINARY',adodbapi.Binary(binfld)) self.helpTestDataType("varbinary(100)",'BINARY',adodbapi.Binary(binfld)) Index: test_adodbapi_dbapi20.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/test_adodbapi_dbapi20.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_adodbapi_dbapi20.py 2 Feb 2009 03:48:41 -0000 1.4 --- test_adodbapi_dbapi20.py 6 Feb 2009 03:35:11 -0000 1.5 *************** *** 4,8 **** import dbapi20 import unittest ! import os, sys, string #attempt to find adodbapi in this directory's parent --- 4,8 ---- import dbapi20 import unittest ! import os, sys #attempt to find adodbapi in this directory's parent *************** *** 39,43 **** def testMethodName(self): ! return string.split(self.id(),'.')[-1] def setUp(self): --- 39,43 ---- def testMethodName(self): ! return self.id().split('.')[-1] def setUp(self): Index: RunTests.bat =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/RunTests.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RunTests.bat 11 Nov 2008 23:54:30 -0000 1.2 --- RunTests.bat 6 Feb 2009 03:35:11 -0000 1.3 *************** *** 1,2 **** --- 1,5 ---- + if not "%PYTHON%"=="" goto skip_python + set PYTHON=python + :skip_python Echo on echo . *************** *** 5,30 **** echo . REM unit test ! adodbapitest.py ! echo . ! echo . ! REM generic test ! @echo . ! test_adodbapi_dbapi20.py ! echo . ! echo . ! db_print.py ! echo . ! del *.pyc ! del *.pyo ! del ..\adodbapi.pyc ! echo . ! call ipy.bat adodbapitest.py echo . echo . REM generic test ! @echo . ! call ipy.bat test_adodbapi_dbapi20.py echo . - call ipy.bat db_print.py echo . pause Testing complete --- 8,17 ---- echo . REM unit test ! %PYTHON% adodbapitest.py echo . echo . REM generic test ! %PYTHON% test_adodbapi_dbapi20.py echo . echo . pause Testing complete Index: dbapi20.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/dbapi20.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbapi20.py 2 Feb 2009 03:48:41 -0000 1.3 --- dbapi20.py 6 Feb 2009 03:35:11 -0000 1.4 *************** *** 12,16 **** ''' - __rcs_id__ = '$Id$' __version__ = '$Revision$'[11:-2] __author__ = 'Stuart Bishop <ze...@sh...>' --- 12,15 ---- *************** *** 20,26 **** import sys # $Log$ ! # Revision 1.3 2009/02/02 03:48:41 kf7xm ! # adodbapi v2.2.6 works with Python 3.0 (after 2to3) # # Revision 1.1.1.1.2.1 2008/09/20 19:54:59 rupole --- 19,28 ---- import sys + # Revision 3.0 2009/2/4 kf7xm + # Updates to make Python 3.0 compatible + # # $Log$ ! # Revision 1.4 2009/02/06 03:35:11 kf7xm ! # Tested okay with Python 3.0, includes last minute patches from Mark H. # # Revision 1.1.1.1.2.1 2008/09/20 19:54:59 rupole *************** *** 73,76 **** --- 75,82 ---- # - Fix bugs in test_setoutputsize_basic and test_setinputsizes # + def str2bytes(sval): + if sys.version_info < (3,0) and isinstance(sval, str): + sval = sval.decode("latin1") + return sval.encode("latin1") class DatabaseAPI20Test(unittest.TestCase): *************** *** 836,841 **** def test_Binary(self): ! b = self.driver.Binary('Something') ! b = self.driver.Binary('') def test_STRING(self): --- 842,847 ---- def test_Binary(self): ! b = self.driver.Binary(str2bytes('Something')) ! b = self.driver.Binary(str2bytes('')) def test_STRING(self): |
|
From: Vernon C. <kf...@us...> - 2009-02-06 03:35:17
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10319 Modified Files: adodbapi.py readme.txt Log Message: Tested okay with Python 3.0, includes last minute patches from Mark H. Index: adodbapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/adodbapi.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** adodbapi.py 2 Feb 2009 03:48:41 -0000 1.7 --- adodbapi.py 6 Feb 2009 03:35:11 -0000 1.8 *************** *** 227,231 **** secondsperday=86400 # 24*60*60 #ComDate is number of days since 1899-12-31, gmtime epoch is 1970-1-1 = 25569 days ! t=time.gmtime(secondsperday*(fcomDate-25569.0)) return t #year,month,day,hour,minute,second,weekday,julianday,daylightsaving=t --- 227,231 ---- secondsperday=86400 # 24*60*60 #ComDate is number of days since 1899-12-31, gmtime epoch is 1970-1-1 = 25569 days ! t=time.localtime(secondsperday*(fcomDate-25569.0)) return t #year,month,day,hour,minute,second,weekday,julianday,daylightsaving=t *************** *** 725,729 **** tbk += u'-- Trying parameter %d = %s\n' \ %(parmIndx, repr(parameters[parmIndx])) ! tblist=traceback.format_exception(sys.exc_type,sys.exc_value,sys.exc_traceback,8) tb=''.join(tblist) tracebackhistory = tbk + tb + u'-- on command: "%s"\n-- with parameters: %s' \ --- 725,730 ---- tbk += u'-- Trying parameter %d = %s\n' \ %(parmIndx, repr(parameters[parmIndx])) ! exc_type,exc_value,exc_traceback = sys.exc_info() ! tblist=traceback.format_exception(exc_type,exc_value,exc_traceback,8) tb=''.join(tblist) tracebackhistory = tbk + tb + u'-- on command: "%s"\n-- with parameters: %s' \ Index: readme.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/readme.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** readme.txt 2 Feb 2009 03:48:41 -0000 1.7 --- readme.txt 6 Feb 2009 03:35:11 -0000 1.8 *************** *** 35,41 **** Whats new in version 2.2.6 1. Actually works in Python 3.0 (using pywin32 212.6) after running thru 2to3 ! 2. (Produces an error in dbapi20 test when trying adodbapi.Buffer('This is a string') in Python 3.0) ! 3. When a value with an exact midnight time is retrieved from a DATETIME column, return a datetime.datetime, ! not a datetime.date. Whats new in version 2.2.5 --- 35,43 ---- 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) Whats new in version 2.2.5 |
|
From: Mark H. <mha...@us...> - 2009-02-05 06:59:23
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13007/isapi Modified Files: install.py Log Message: convert module name to the long version before using it Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** install.py 2 Feb 2009 12:55:28 -0000 1.22 --- install.py 5 Feb 2009 06:59:15 -0000 1.23 *************** *** 7,10 **** --- 7,11 ---- from win32com.client import GetObject, Dispatch from win32com.client.gencache import EnsureModule, EnsureDispatch + import win32api import pythoncom import winerror *************** *** 669,673 **** argv = argv or sys.argv ! conf_module_name = conf_module_name or sys.argv[0] if opt_parser is None: # Build our own parser. --- 670,685 ---- argv = argv or sys.argv ! if not conf_module_name: ! conf_module_name = sys.argv[0] ! # convert to a long name so that if we were somehow registered with ! # the "short" version but unregistered with the "long" version we ! # still work (that will depend on exactly how the installer was ! # started) ! try: ! conf_module_name = win32api.GetLongPathName(conf_module_name) ! except win32api.error, exc: ! log(2, "Couldn't determine the long name for %r: %s" % ! (conf_module_name, exc)) ! if opt_parser is None: # Build our own parser. |
|
From: Mark H. <mha...@us...> - 2009-02-05 06:58:18
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12908/com/win32com/test Modified Files: util.py Log Message: delete temp file Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** util.py 9 Jan 2009 00:30:23 -0000 1.19 --- util.py 5 Feb 2009 06:58:11 -0000 1.20 *************** *** 95,98 **** --- 95,99 ---- rc = os.system(cmd) output = open(output_name, "r").read().strip() + os.remove(output_name) class Failed(Exception): pass try: |
|
From: Mark H. <mha...@us...> - 2009-02-04 11:27:13
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29832/test Modified Files: handles.py Log Message: allow PyHANDLE objects to be compared to int/longs Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** handles.py 4 Feb 2009 02:45:48 -0000 1.7 --- handles.py 4 Feb 2009 11:27:05 -0000 1.8 *************** *** 87,94 **** --- 87,116 ---- self.failUnlessEqual(d['foo'], h) + def testHandleInDictThenInt(self): + h=pywintypes.HANDLE(1) + d = dict(foo=h) + self.failUnlessEqual(d['foo'], 1) + def testHandleCompareNone(self): h=pywintypes.HANDLE(1) self.failIfEqual(h, None) self.failIfEqual(None, h) + # ensure we use both __eq__ and __ne__ ops + self.failIf(h==None) + self.failUnless(h!=None) + + def testHandleCompareInt(self): + h=pywintypes.HANDLE(1) + self.failIfEqual(h, 0) + self.failUnlessEqual(h, 1) + # ensure we use both __eq__ and __ne__ ops + self.failUnless(h==1) + self.failUnless(1==h) + self.failIf(h!=1) + self.failIf(1!=h) + self.failIf(h==0) + self.failIf(0==h) + self.failUnless(h!=0) + self.failUnless(0!=h) def testHandleNonZero(self): |
|
From: Mark H. <mha...@us...> - 2009-02-04 11:27:11
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29832/src Modified Files: PyHANDLE.cpp Log Message: allow PyHANDLE objects to be compared to int/longs Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PyHANDLE.cpp 4 Feb 2009 04:07:54 -0000 1.21 --- PyHANDLE.cpp 4 Feb 2009 11:27:05 -0000 1.22 *************** *** 268,277 **** PyObject *PyHANDLE::richcompare(PyObject *other, int op) { ! if (!PyHANDLE_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } ! ! BOOL e = m_handle == ((PyHANDLE *)other)->m_handle; PyObject *ret; if (op==Py_EQ) --- 268,282 ---- PyObject *PyHANDLE::richcompare(PyObject *other, int op) { ! HANDLE hother; ! if (PyHANDLE_Check(other)) { ! hother = ((PyHANDLE *)other)->m_handle; ! } else if (PyInt_Check(other) || PyLong_Check(other)) { ! if (!PyWinLong_AsVoidPtr(other, &hother)) ! return NULL; ! } else { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } ! BOOL e = m_handle == hother; PyObject *ret; if (op==Py_EQ) |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:08:23
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22557/com/win32com/test Modified Files: testvb.py Log Message: add various rich comparison tests Index: testvb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testvb.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** testvb.py 3 Feb 2009 03:23:07 -0000 1.27 --- testvb.py 4 Feb 2009 04:08:19 -0000 1.28 *************** *** 359,362 **** --- 359,374 ---- # Now do some object equality tests. assert s==s + assert s!=None + if sys.version_info > (3,0): + try: + s < None + raise error("Expected type error") + except TypeError: + pass + try: + None < s + raise error("Expected type error") + except TypeError: + pass assert s != s.sub_val import copy *************** *** 435,438 **** --- 447,466 ---- assert not ob._oleobj_!=ob._oleobj_.QueryInterface(pythoncom.IID_IUnknown) + assert ob._oleobj_!=None + assert None!=ob._oleobj_ + assert ob!=None + assert None!=ob + if sys.version_info > (3,0): + try: + ob < None + raise error("Expected type error") + except TypeError: + pass + try: + None < ob + raise error("Expected type error") + except TypeError: + pass + assert ob._oleobj_.QueryInterface(pythoncom.IID_IUnknown)==ob._oleobj_ assert not ob._oleobj_.QueryInterface(pythoncom.IID_IUnknown)!=ob._oleobj_ |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:08:03
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22484/win32/src Modified Files: PyHANDLE.cpp PyIID.cpp PyWinObjects.h Log Message: Remove __cmp__ and tp_compare slots for PyHANDLE and PyIID objects and return Py_NotImplemented in richcmp functions when faced with different types. Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PyWinObjects.h 19 Dec 2008 05:24:35 -0000 1.19 --- PyWinObjects.h 4 Feb 2009 04:07:54 -0000 1.20 *************** *** 18,22 **** /* Python support */ - int compare(PyObject *ob); PyObject *richcompare(PyObject *other, int op); long hash(void); --- 18,21 ---- *************** *** 26,30 **** static void deallocFunc(PyObject *ob); static int printFunc(PyObject *ob, FILE *fp, int flags); - static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); static long hashFunc(PyObject *ob); --- 25,28 ---- *************** *** 139,143 **** /* Python support */ - int compare(PyObject *ob); PyObject *richcompare(PyObject *other, int op); --- 137,140 ---- *************** *** 148,152 **** static void deallocFunc(PyObject *ob); static int printFunc(PyObject *ob, FILE *fp, int flags); - static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); --- 145,148 ---- Index: PyIID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIID.cpp 11 Dec 2008 00:25:40 -0000 1.11 --- PyIID.cpp 4 Feb 2009 04:07:54 -0000 1.12 *************** *** 170,175 **** 0, /* tp_getattr */ 0, /* tp_setattr */ ! // @pymeth __cmp__|Used when IID objects are compared. ! PyIID::compareFunc, /* tp_compare */ // @pymeth __repr__|Used whenever a repr() is called for the object PyIID::reprFunc, /* tp_repr */ --- 170,174 ---- 0, /* tp_getattr */ 0, /* tp_setattr */ ! 0, /* tp_compare */ // @pymeth __repr__|Used whenever a repr() is called for the object PyIID::reprFunc, /* tp_repr */ *************** *** 231,270 **** } - int PyIID::compare(PyObject *ob) - { - return memcmp(&m_iid, &((PyIID *)ob)->m_iid, sizeof(m_iid)); - } - // Py3k requires that objects implement richcompare to be used as dict keys PyObject *PyIID::richcompare(PyObject *other, int op) { ! BOOL e; ! if (PyIID_Check(other)) ! e=IsEqualIID(m_iid, ((PyIID *)other)->m_iid); ! else ! e=FALSE; ! if (op==Py_EQ){ ! if (e){ ! Py_INCREF(Py_True); ! return Py_True; ! } ! else{ ! Py_INCREF(Py_False); ! return Py_False; ! } ! } ! if (op==Py_NE){ ! if (!e){ ! Py_INCREF(Py_True); ! return Py_True; ! } ! else{ ! Py_INCREF(Py_False); ! return Py_False; ! } ! } ! PyErr_SetString(PyExc_TypeError, "IIDs only compare equal or not equal"); ! return NULL; } --- 230,251 ---- } // Py3k requires that objects implement richcompare to be used as dict keys PyObject *PyIID::richcompare(PyObject *other, int op) { ! if (!PyIID_Check(other)) { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } ! BOOL e = IsEqualIID(m_iid, ((PyIID *)other)->m_iid); ! PyObject *ret; if (op==Py_EQ){ ! ret = e ? Py_True : Py_False; ! } ! else if (op==Py_NE) { ! ret = e ? Py_False : Py_True; ! } else ! ret = Py_NotImplemented; ! Py_INCREF(ret); ! return ret; } *************** *** 299,308 **** } - // @pymethod int|PyIID|__cmp__|Used when IID objects are compared. - int PyIID::compareFunc(PyObject *ob1, PyObject *ob2) - { - return ((PyIID *)ob1)->compare(ob2); - } - // Py3k requires that objects implement richcompare to be used as dict keys PyObject *PyIID::richcompareFunc(PyObject *self, PyObject *other, int op) --- 280,283 ---- Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PyHANDLE.cpp 17 Dec 2008 13:12:56 -0000 1.20 --- PyHANDLE.cpp 4 Feb 2009 04:07:54 -0000 1.21 *************** *** 166,171 **** 0, /* tp_getattr */ 0, /* tp_setattr */ ! // @pymeth __cmp__|Used when HANDLE objects are compared. ! PyHANDLE::compareFunc, /* tp_compare */ PyHANDLE::strFunc, /* tp_repr */ &PyHANDLE_NumberMethods, /* tp_as_number */ --- 166,170 ---- 0, /* tp_getattr */ 0, /* tp_setattr */ ! 0, /* tp_compare */ PyHANDLE::strFunc, /* tp_repr */ &PyHANDLE_NumberMethods, /* tp_as_number */ *************** *** 267,284 **** } - int PyHANDLE::compare(PyObject *ob) - { - - return m_handle == ((PyHANDLE *)ob)->m_handle ? 0 : - (m_handle < ((PyHANDLE *)ob)->m_handle ? -1 : 1); - } - PyObject *PyHANDLE::richcompare(PyObject *other, int op) { ! BOOL e; ! if (PyHANDLE_Check(other)) ! e=compare((PyHANDLE *)other)==0; ! else ! e=FALSE; PyObject *ret; if (op==Py_EQ) --- 266,277 ---- } PyObject *PyHANDLE::richcompare(PyObject *other, int op) { ! if (!PyHANDLE_Check(other)) { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } ! ! BOOL e = m_handle == ((PyHANDLE *)other)->m_handle; PyObject *ret; if (op==Py_EQ) *************** *** 286,294 **** else if (op==Py_NE) ret = !e ? Py_True : Py_False; ! else { ! PyErr_SetString(PyExc_TypeError, "HANDLEs only compare equal or not equal"); ! ret = NULL; ! } ! Py_XINCREF(ret); return ret; } --- 279,285 ---- else if (op==Py_NE) ret = !e ? Py_True : Py_False; ! else ! ret = Py_NotImplemented; ! Py_INCREF(ret); return ret; } *************** *** 321,330 **** - // @pymethod int|PyHANDLE|__cmp__|Used when objects are compared. - int PyHANDLE::compareFunc(PyObject *ob1, PyObject *ob2) - { - return ((PyHANDLE *)ob1)->compare(ob2); - } - PyObject *PyHANDLE::richcompareFunc(PyObject *ob, PyObject *other, int op) { --- 312,315 ---- |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:07:59
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22484/win32/test Modified Files: test_pywintypes.py Log Message: Remove __cmp__ and tp_compare slots for PyHANDLE and PyIID objects and return Py_NotImplemented in richcmp functions when faced with different types. Index: test_pywintypes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_pywintypes.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_pywintypes.py 25 Jan 2009 03:21:32 -0000 1.7 --- test_pywintypes.py 4 Feb 2009 04:07:54 -0000 1.8 *************** *** 1,2 **** --- 1,3 ---- + import sys import unittest import pywintypes *************** *** 4,7 **** --- 5,9 ---- from pywin32_testutil import str2bytes, ob2memory import datetime + import operator class TestCase(unittest.TestCase): *************** *** 75,78 **** --- 77,99 ---- self.assertRaises(TypeError, pywintypes.IID, 0, True) # no buffer + def testGUIDRichCmp(self): + s = "{00020400-0000-0000-C000-000000000046}" + iid = pywintypes.IID(s) + self.failIf(s==None) + self.failIf(None==s) + self.failUnless(s!=None) + self.failUnless(None!=s) + if sys.version_info > (3,0): + self.assertRaises(TypeError, operator.gt, None, s) + self.assertRaises(TypeError, operator.gt, s, None) + self.assertRaises(TypeError, operator.lt, None, s) + self.assertRaises(TypeError, operator.lt, s, None) + + def testGUIDInDict(self): + s = "{00020400-0000-0000-C000-000000000046}" + iid = pywintypes.IID(s) + d = dict(item=iid) + self.failUnlessEqual(d['item'], iid) + if __name__ == '__main__': unittest.main() |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:06:14
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22342/com/win32com/src Modified Files: PyRecord.cpp Log Message: Remove __cmp__ and tp_compare slots and return Py_NotImplemented in richcmp functions when faced with different types. Index: PyRecord.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyRecord.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PyRecord.cpp 3 Jan 2009 05:50:50 -0000 1.15 --- PyRecord.cpp 4 Feb 2009 04:06:10 -0000 1.16 *************** *** 645,660 **** PyObject *ret = NULL; if (op != Py_EQ && op != Py_NE) { ! PyErr_SetString(PyExc_TypeError, "IIDs only compare equal or not equal"); ! return NULL; } int success = op == Py_EQ ? TRUE : FALSE; ! if (self->ob_type != other->ob_type) ! return PyBool_FromLong(!success); PyRecord *pyself = (PyRecord *)self; PyRecord *pyother = (PyRecord *)other; if (!pyself->pri->IsMatchingType(pyother->pri)) { ! // Not matching types, so must compare False. ! return PyBool_FromLong(!success); } // Need to do a recursive compare, as some elements may be pointers --- 645,663 ---- PyObject *ret = NULL; if (op != Py_EQ && op != Py_NE) { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; } int success = op == Py_EQ ? TRUE : FALSE; ! if (self->ob_type != other->ob_type) { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } PyRecord *pyself = (PyRecord *)self; PyRecord *pyother = (PyRecord *)other; if (!pyself->pri->IsMatchingType(pyother->pri)) { ! // Not matching types, so can't compare. ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; } // Need to do a recursive compare, as some elements may be pointers |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:04:28
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22042/win32/src Modified Files: PySID.cpp PySecurityObjects.h Log Message: Remove __cmp__ and tp_compare slots from PySIDs and return Py_NotImplemented in richcmp functions when faced with different types. Index: PySID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PySID.cpp 25 Jan 2009 03:16:35 -0000 1.16 --- PySID.cpp 4 Feb 2009 04:04:20 -0000 1.17 *************** *** 244,249 **** 0, /* tp_getattr */ 0, /* tp_setattr */ ! // @pymeth __cmp__|Used when objects are compared. ! PySID::compareFunc, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ --- 244,248 ---- 0, /* tp_getattr */ 0, /* tp_setattr */ ! 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ *************** *** 306,324 **** } - int PySID::compare(PyObject *ob) - { - PSID p2; - if (!PyWinObject_AsSID(ob, &p2, FALSE)) - return -2; - return EqualSid(this->GetSID(), p2)==FALSE; - } - PyObject *PySID::richcompare(PyObject *other, int op) { ! BOOL e; ! if (PySID_Check(other)) ! e=compare((PyHANDLE *)other)==0; ! else ! e=FALSE; PyObject *ret; if (op==Py_EQ) --- 305,318 ---- } PyObject *PySID::richcompare(PyObject *other, int op) { ! if (!PySID_Check(other)) { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } ! PSID p2; ! if (!PyWinObject_AsSID(other, &p2, FALSE)) ! return NULL; ! BOOL e = EqualSid(GetSID(), p2); PyObject *ret; if (op==Py_EQ) *************** *** 326,344 **** else if (op==Py_NE) ret = !e ? Py_True : Py_False; ! else { ! PyErr_SetString(PyExc_TypeError, "SIDs only compare equal or not equal"); ! ret = NULL; ! } ! Py_XINCREF(ret); return ret; } - // @pymethod int|PySID|__cmp__|Used when objects are compared. - // @comm This method calls the Win32 API function EqualSid - int PySID::compareFunc(PyObject *ob1, PyObject *ob2) - { - return ((PySID *)ob1)->compare(ob2); - } - PyObject *PySID::richcompareFunc(PyObject *ob1, PyObject *ob2, int op) { --- 320,329 ---- else if (op==Py_NE) ret = !e ? Py_True : Py_False; ! else ! ret = Py_NotImplemented; ! Py_INCREF(ret); return ret; } PyObject *PySID::richcompareFunc(PyObject *ob1, PyObject *ob2, int op) { Index: PySecurityObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySecurityObjects.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PySecurityObjects.h 25 Jan 2009 03:16:35 -0000 1.15 --- PySecurityObjects.h 4 Feb 2009 04:04:20 -0000 1.16 *************** *** 101,109 **** /* Python support */ - int compare(PyObject *ob); PyObject *richcompare(PyObject *other, int op); static void deallocFunc(PyObject *ob); - static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *ob1, PyObject *ob2, int op); static PyObject *strFunc(PyObject *ob); --- 101,107 ---- |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:04:24
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22042/win32/test Modified Files: test_security.py Log Message: Remove __cmp__ and tp_compare slots from PySIDs and return Py_NotImplemented in richcmp functions when faced with different types. Index: test_security.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_security.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_security.py 7 Jan 2009 06:03:29 -0000 1.6 --- test_security.py 4 Feb 2009 04:04:20 -0000 1.7 *************** *** 19,22 **** --- 19,37 ---- win32security.LookupAccountName('','Administrator')[0]) + def testNESID(self): + self.failUnless(self.pwr_sid==self.pwr_sid) + self.failUnless(self.pwr_sid!=self.admin_sid) + + def testNEOther(self): + self.failUnless(self.pwr_sid!=None) + self.failUnless(None!=self.pwr_sid) + self.failIf(self.pwr_sid==None) + self.failIf(None==self.pwr_sid) + self.failIfEqual(None, self.pwr_sid) + + def testSIDInDict(self): + d = dict(foo=self.pwr_sid) + self.failUnlessEqual(d['foo'], self.pwr_sid) + def testBuffer(self): self.failUnlessEqual(ob2memory(win32security.LookupAccountName('','Administrator')[0]), |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:01:31
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21528/com/win32com/src Modified Files: MiscTypes.cpp PyIBase.cpp Log Message: Remove __cmp__ and tp_compare slots from COM objects and return Py_NotImplemented in richcmp functions when faced with different types. Index: MiscTypes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/MiscTypes.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MiscTypes.cpp 19 Dec 2008 02:28:48 -0000 1.11 --- MiscTypes.cpp 4 Feb 2009 04:01:25 -0000 1.12 *************** *** 49,58 **** 0, /*tp_getattr*/ 0, /*tp_setattr*/ ! // For b/w compat, we still allow 'cmp()' to work with Py2k, but for Py3k only rich compare is supported. ! #if (PY_VERSION_HEX < 0x03000000) ! PyIBase::cmp, /*tp_compare*/ ! #else ! 0, ! #endif (reprfunc)PyIBase::repr, /*tp_repr*/ 0, /*tp_as_number*/ --- 49,53 ---- 0, /*tp_getattr*/ 0, /*tp_setattr*/ ! 0, /*tp_compare*/ (reprfunc)PyIBase::repr, /*tp_repr*/ 0, /*tp_as_number*/ Index: PyIBase.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIBase.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIBase.cpp 19 Dec 2008 02:28:48 -0000 1.9 --- PyIBase.cpp 4 Feb 2009 04:01:25 -0000 1.10 *************** *** 79,84 **** int c = cmp(ob1, ob2); // BUT - it doesn't propogate exceptions correctly. ! if (c==-1 && PyErr_Occurred()) return NULL; assert(!PyErr_Occurred()); // should always have returned -1 on error. BOOL ret; --- 79,92 ---- int c = cmp(ob1, ob2); // BUT - it doesn't propogate exceptions correctly. ! if (c==-1 && PyErr_Occurred()) { ! // if the error related to the type of the object, ! // rich-compare wants Py_NotImplemented returned. ! if (PyErr_ExceptionMatches(PyExc_TypeError)) { ! PyErr_Clear(); ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; ! } return NULL; + } assert(!PyErr_Occurred()); // should always have returned -1 on error. BOOL ret; *************** *** 88,93 **** ret = c != 0; else { ! PyErr_SetString(PyExc_TypeError, "Interface pointers only compare equal or not equal"); ! return NULL; } return PyBool_FromLong(ret); --- 96,101 ---- ret = c != 0; else { ! Py_INCREF(Py_NotImplemented); ! return Py_NotImplemented; } return PyBool_FromLong(ret); |
|
From: Mark H. <mha...@us...> - 2009-02-04 04:01:31
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21528/com/win32com/client Modified Files: __init__.py dynamic.py Log Message: Remove __cmp__ and tp_compare slots from COM objects and return Py_NotImplemented in richcmp functions when faced with different types. Index: dynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dynamic.py 28 Jan 2009 11:37:02 -0000 1.29 --- dynamic.py 4 Feb 2009 04:01:25 -0000 1.30 *************** *** 201,212 **** # Delegate comparison to the oleobjs, as they know how to do identity. - def __cmp__(self, other): - other = getattr(other, "_oleobj_", other) - return cmp(self._oleobj_, other) - def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other def __int__(self): return int(self.__call__()) --- 201,212 ---- # Delegate comparison to the oleobjs, as they know how to do identity. def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other + def __ne__(self, other): + other = getattr(other, "_oleobj_", other) + return self._oleobj_ != other + def __int__(self): return int(self.__call__()) Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** __init__.py 4 Jan 2009 22:35:14 -0000 1.39 --- __init__.py 4 Feb 2009 04:01:25 -0000 1.40 *************** *** 444,455 **** return "<%s.%s instance at 0x%s>" % (mod_name, self.__class__.__name__, id(self)) # Delegate comparison to the oleobjs, as they know how to do identity. - def __cmp__(self, other): - other = getattr(other, "_oleobj_", other) - return cmp(self._oleobj_, other) - def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): return self._get_good_object_( --- 444,455 ---- return "<%s.%s instance at 0x%s>" % (mod_name, self.__class__.__name__, id(self)) # Delegate comparison to the oleobjs, as they know how to do identity. def __eq__(self, other): other = getattr(other, "_oleobj_", other) return self._oleobj_ == other + def __ne__(self, other): + other = getattr(other, "_oleobj_", other) + return self._oleobj_ != other + def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): return self._get_good_object_( |
|
From: Mark H. <mha...@us...> - 2009-02-04 02:45:54
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11437 Modified Files: handles.py Log Message: add some richcmp tests for handles Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** handles.py 25 Jan 2009 03:20:43 -0000 1.6 --- handles.py 4 Feb 2009 02:45:48 -0000 1.7 *************** *** 82,85 **** --- 82,102 ---- win32api.GetProcAddress(sys.dllhandle, h) + def testHandleInDict(self): + h=pywintypes.HANDLE(1) + d = dict(foo=h) + self.failUnlessEqual(d['foo'], h) + + def testHandleCompareNone(self): + h=pywintypes.HANDLE(1) + self.failIfEqual(h, None) + self.failIfEqual(None, h) + + def testHandleNonZero(self): + h=pywintypes.HANDLE(0) + self.failIf(h) + + h=pywintypes.HANDLE(1) + self.failUnless(h) + def testLong(self): # sys.maxint+1 should always be a 'valid' handle, treated as an |
|
From: Mark H. <mha...@us...> - 2009-02-04 02:34:36
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9421 Modified Files: CHANGES.txt Log Message: prevent win32com.universal triggering DEP (yay!) Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** CHANGES.txt 31 Jan 2009 05:48:36 -0000 1.44 --- CHANGES.txt 4 Feb 2009 02:34:24 -0000 1.45 *************** *** 22,25 **** --- 22,30 ---- - Vernon Cole: for help with porting adodbapi to py3k. + * pythoncom servers which implemented 'universal' vtable interfaces from a + typelib could cause Data Execution Protection (DEP) to be triggered if + enabled. This has been resolved and such servers now work correctly with + DEP enabled. + * Fixed memory leak in win32wnet.WNetEnumResource. |
|
From: Mark H. <mha...@us...> - 2009-02-04 02:34:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9421/com/win32com/src Modified Files: univgw.cpp Log Message: prevent win32com.universal triggering DEP (yay!) Index: univgw.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** univgw.cpp 19 Dec 2008 02:28:48 -0000 1.12 --- univgw.cpp 4 Feb 2009 02:34:24 -0000 1.13 *************** *** 215,220 **** // make a copy of code and plug in the appropriate values. ! // NOTE: the call address is relative ! code = (unsigned char *)malloc(sizeof(func_template)); memcpy(code, func_template, sizeof(func_template)); *(long *)&code[19] = index; --- 215,226 ---- // make a copy of code and plug in the appropriate values. ! // NOTE: the call address is relative, and that the memory we allocate ! // must be marked as 'executable' or DEP will kill us. To be good ! // citizens we leave the final page 'executable' but read-only. ! code = (unsigned char *)VirtualAlloc(NULL, sizeof(func_template), MEM_COMMIT, PAGE_READWRITE); ! if (code==NULL) { ! PyErr_NoMemory(); ! return NULL; // caller sets memory error ! } memcpy(code, func_template, sizeof(func_template)); *(long *)&code[19] = index; *************** *** 222,225 **** --- 228,238 ---- *(short *)&code[35] = argsize; + DWORD oldprotect; + if (!VirtualProtect(code, sizeof(func_template), PAGE_EXECUTE, &oldprotect)) { + VirtualFree(code, 0, MEM_RELEASE); + PyErr_SetString(PyExc_RuntimeError, "failed to set memory attributes to executable"); + return NULL; + } + #else // _M_IX86 /* The MAINWIN toolkit allows us to build this on Linux!!! */ *************** *** 310,315 **** for ( int i = vtbl->cMethod; i-- > (int)vtbl->cReservedMethods; ) if ( vtbl->methods[i] != NULL ) ! free((void *)vtbl->methods[i]); ! free(vtbl); } --- 323,328 ---- for ( int i = vtbl->cMethod; i-- > (int)vtbl->cReservedMethods; ) if ( vtbl->methods[i] != NULL ) ! VirtualFree((void *)vtbl->methods[i], 0, MEM_RELEASE); ! VirtualFree(vtbl, 0, MEM_RELEASE); } *************** *** 365,369 **** // compute the size of the structure plus the method pointers size_t size = sizeof(gw_vtbl) + count * sizeof(pfnGWMethod); ! gw_vtbl * vtbl = (gw_vtbl *)malloc(size); if ( vtbl == NULL ) { --- 378,385 ---- // compute the size of the structure plus the method pointers size_t size = sizeof(gw_vtbl) + count * sizeof(pfnGWMethod); ! // NOTE: we are allocating a function pointer, so the memory we ! // allocate must be marked as 'executable' or DEP will kill us. To be ! // good citizens we leave the final page 'executable' but read-only. ! gw_vtbl * vtbl = (gw_vtbl *)VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); if ( vtbl == NULL ) { *************** *** 372,376 **** return NULL; } ! memset(vtbl, 0, size); vtbl->magic = GW_VTBL_MAGIC; --- 388,392 ---- return NULL; } ! // memset(vtbl, 0, size); - reset by VirtualAlloc vtbl->magic = GW_VTBL_MAGIC; *************** *** 411,422 **** pfnGWMethod meth = make_method(i, argSize + sizeof(gw_object *)); if ( meth == NULL ) - { - (void)PyErr_NoMemory(); goto error; - } vtbl->methods[i + numReservedVtables] = meth; } Py_DECREF(methods); PyObject *result; --- 427,441 ---- pfnGWMethod meth = make_method(i, argSize + sizeof(gw_object *)); if ( meth == NULL ) goto error; vtbl->methods[i + numReservedVtables] = meth; } Py_DECREF(methods); + DWORD oldprotect; + if (!VirtualProtect(vtbl, size, PAGE_EXECUTE, &oldprotect)) { + free_vtbl(vtbl); + PyErr_SetString(PyExc_RuntimeError, "failed to set memory attributes to executable"); + goto error; + } PyObject *result; |