From Ankesh.Pratap at cognizant.com Tue Apr 2 22:45:56 2013 From: Ankesh.Pratap at cognizant.com (Ankesh.Pratap at cognizant.com) Date: Tue, 2 Apr 2013 20:45:56 +0000 Subject: [python-win32] Need help on win32 application error Message-ID: Hi Team, I am facing folowing error while executing python code: Win32 exception occurred releasing IUnknown at 0x03210eb8 Please let me know the resolution of the same. Thanks and Regards, Ankesh Pratap Programmer Analyst Mobile: 91-9884928733 This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. From lizy10b at 126.com Wed Apr 3 02:41:43 2013 From: lizy10b at 126.com (lizy10b) Date: Wed, 3 Apr 2013 08:41:43 +0800 Subject: [python-win32] Py COM module consumes a thrid part C-base python library, can not run in C# under x86 build mode Message-ID: <201304030841370538357@126.com> Hi there, I am new to Python win32. The problem I am facing is my environment is Win7-x64 ,VS2008 SP1, Pywin32-218.win32-py2.6, I worte a python module (py file) which consumes a third part C-based python library (dll wrapped by ctypes), and modify it using Python Win32 to make it COM visiable. After registering the COM, I try to consume it in C#.Net. In x86 mode an exception occured saying can not find the C-based python library's dll file, but when I changed the build mode to x64, it runs smoothly..... The dll locates inside third part C-based python library's folder, so I copied it and place it in the root of the python installation path (C:\Python26\) , the C:\Windows\System32 ,and C:\Windows\SysWOW64, and the C# project's folder. But it still does not work in x86 mode. The Python, the third part C-based python librarya and the Python-Win32 are all x86 edition, I don't konw why it happen. Thanks Zhiyu LI Student China 2013-04-03 lizy10b -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Apr 3 20:23:48 2013 From: timr at probo.com (Tim Roberts) Date: Wed, 3 Apr 2013 11:23:48 -0700 Subject: [python-win32] Py COM module consumes a thrid part C-base python library, can not run in C# under x86 build mode In-Reply-To: <201304030841370538357@126.com> References: <201304030841370538357@126.com> Message-ID: <515C73B4.7010207@probo.com> lizy10b wrote: > , > I am new to Python win32. > The problem I am facing is my environment is Win7-x64 ,VS2008 SP1, > Pywin32-218.win32-py2.6, I worte a python module (py file) which > consumes a third part C-based python library (dll wrapped by ctypes), > and modify it using Python Win32 to make it COM visiable. After > registering the COM, I try to consume it in C#.Net. In x86 mode an > exception occured saying can not find the C-based python library's dll > file, but when I changed the build mode to x64, it runs smoothly..... > > The dll locates inside third part C-based python library's folder, > so I copied it and place it in the root of the python installation > path (C:\Python26\) , the C:\Windows\System32 ,and > C:\Windows\SysWOW64, and the C# project's folder. But it still does > not work in x86 mode. > > The Python, the third part C-based python librarya and the > Python-Win32 are all x86 edition, I don't konw why it happen. I got a little lost in your description, but let me give you some key points to remember. A 64-bit process can only load 64-bit DLLs. That includes COM objects, if they are "in-process" objects. A 32-bit process can only load 32-bit DLLs. Again, that includes in-process COM objects. On a 64-bit system, \Windows\System32 should only contain 64-bit DLLs. \Windows\SysWow64 should only contain 32-bit DLLs. If you copied a 32-bit DLL to System32, that's a problem. You need to remove it. Actually, your COM DLL shouldn't be in either of those two directories. They should be in your application's directory. When you register it, it will record the actual location of the DLL in the registry. That's how the system finds you -- not by doing a DLL path search. A .NET application, by default, does a just-in-time compilation to match the native bit size. If you compile a C# application in "Any CPU", then it will always be a 64-bit application on a 64-bit system and a 32-bit application on a 32-bit system. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Wed Apr 3 20:35:12 2013 From: timr at probo.com (Tim Roberts) Date: Wed, 3 Apr 2013 11:35:12 -0700 Subject: [python-win32] Need help on win32 application error In-Reply-To: References: Message-ID: <515C7660.1010803@probo.com> Ankesh.Pratap at cognizant.com wrote: > I am facing folowing error while executing python code: > Win32 exception occurred releasing IUnknown at 0x03210eb8 > Please let me know the resolution of the same. This often means you are deleting an object that was already deleted earlier. What was the context of this? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From vernondcole at gmail.com Mon Apr 8 07:57:11 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Sun, 7 Apr 2013 23:57:11 -0600 Subject: [python-win32] Remote ado: should I use PyRO or DCOM? Message-ID: Dear Gurus: I have committed to the django community that I would provide a prototype remote adodbapi function -- so that django running on Linux will be able to open a MS SQL Server database. This work, if successful, may be expected to result in SQL Server support becoming part of mainstream django. The major modifications to adodbapi to support this are complete: you can now use keyword arguments (like user= and host=) in your .connect() call and have them inserted into your connection string. I am trying to create a remote api connection using PyRO to communicate with a server utility on Windows. I can actually execute a simple query now. It occurred to me this morning that using PyRO to emulate remote COM calls may not be the smartest design. Perhaps I should be using DCOM -- that is what DCOM was designed for after all. A quick check shows that there are a number of Linux DCOM implementations out there, from both the WINE and SAMBA communities, and even a commercial version. Let me start by saying that I know absolutely nothing about DCOM, including the level of DCOM support in pywin32. (I did not know much about PyRO either, before last week.) So I am asking advice on which way to jump: 1) stick with PyRO all the way. 2) drop the PyRO effort immediately and start using DCOM. 3) go ahead and finish a basic remote client using PyRO, but plan on re-doing it in DCOM for full functionality. ??? Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsyring at gmail.com Mon Apr 8 15:28:41 2013 From: rsyring at gmail.com (Randy Syring) Date: Mon, 08 Apr 2013 09:28:41 -0400 Subject: [python-win32] Remote ado: should I use PyRO or DCOM? In-Reply-To: References: Message-ID: <5162C609.3010900@gmail.com> I'm not 100% sure what you are trying to do, but I'm wondering if there are better ways to connect to MSSQL from Linux: * http://www.microsoft.com/en-us/download/details.aspx?id=28160 (+ pyodbc) * pymssql (use HG tip or the very latest release, the project has been somewhat neglected but the premise is sound and we have a new contributor who has been driving the project forward) *Randy Syring* Development | Executive Director Direct: 502.276.0459 Office: 502.212.9913 Level 12 Technologies /Principled People | Technology that Works/ On 04/08/2013 01:57 AM, Vernon D. Cole wrote: > Dear Gurus: > > I have committed to the django community that I would provide a > prototype remote adodbapi function -- so that django running on Linux > will be able to open a MS SQL Server database. This work, if > successful, may be expected to result in SQL Server support becoming > part of mainstream django. The major modifications to adodbapi to > support this are complete: you can now use keyword arguments (like > user= and host=) in your .connect() call and have them inserted into > your connection string. > > I am trying to create a remote api connection using PyRO to > communicate with a server utility on Windows. I can actually execute a > simple query now. > > It occurred to me this morning that using PyRO to emulate remote COM > calls may not be the smartest design. Perhaps I should be using DCOM > -- that is what DCOM was designed for after all. A quick check shows > that there are a number of Linux DCOM implementations out there, from > both the WINE and SAMBA communities, and even a commercial version. > Let me start by saying that I know absolutely nothing about DCOM, > including the level of DCOM support in pywin32. (I did not know much > about PyRO either, before last week.) > > So I am asking advice on which way to jump: > 1) stick with PyRO all the way. > 2) drop the PyRO effort immediately and start using DCOM. > 3) go ahead and finish a basic remote client using PyRO, but plan on > re-doing it in DCOM for full functionality. > ??? > Vernon > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Level-12-Logo-email-sigs.png Type: image/png Size: 4071 bytes Desc: not available URL: From s at vtwireless.com Mon Apr 8 15:52:25 2013 From: s at vtwireless.com (Stan) Date: Mon, 8 Apr 2013 09:52:25 -0400 Subject: [python-win32] Windows Service: Not Starting at Boot Message-ID: Background: I have a small application that I have developed as a Windows Service that is built with the following major libraries: Python 2.6.7 Win32 217 py2exe 0.6.9 (Also WMI, SQLAlchemy, anyjson, psycopg2, etc) The application is designed as a class that extends threading.Thread. The class runs great as a frozen executable, and on a booted Windows XP 32bit system starts correctly. I am having an issue on a Windows XP 32bit system at boot time however. The eventlog logs these messages: Source: Service Control Manager Event ID: 7009 Description: Timeout (30000 milliseconds) waiting for the MyAppName service to connect. Source: Service Control Manager Event ID: 7000 Description: Timeout (30000 milliseconds) waiting for the MyAppName service to connect. On a local virtual machine (SSD, quad core I7) this issue does not happen unless I seriously CPU constrain the VM (~20% CPU limit in VirtualBox). Between it working *after* boot, and working fine on a fast system it seems to be related to service load order. I have tried setting a 'dependency' on 'lanmanworkstation' and 'eventlog' in an attempt to delay startup. The service wrapper script is based on the example in examples\advanced\service.py, and writes to the eventlog. During testing it appears that simply *importing* my main class will cause the application not to start, while excluding the import (and just sticking to the example service.py) allows it to start. With my include in place, no eventlog messages are logged. Does anyone have any approach for debugging a problem like this? I spent most of the weekend progressively allowing more imports and thought I had solved the problem (in a test VM), but the issue persisted on a physical Windows XP machine. Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Wed Apr 10 03:36:59 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Wed, 10 Apr 2013 11:36:59 +1000 Subject: [python-win32] Windows Service: Not Starting at Boot In-Reply-To: References: Message-ID: <5164C23B.8060004@gmail.com> Hi again Stan! On 8/04/2013 11:52 PM, Stan wrote: > (Also WMI, SQLAlchemy, anyjson, psycopg2, etc) ... > The service wrapper script is based on the example in > examples\advanced\service.py, and writes to the eventlog. During > testing it appears that simply /importing/ my main class will cause the > application not to start, while excluding the import (and just sticking > to the example service.py) allows it to start. With my include in > place, no eventlog messages are logged. So the question is what this import does. For example, if the import attempts to use WMI in any way, the hang could well be waiting for it. Peppering the imported code with diagnostics should be able to tell you roughly where the delay comes from. Mark From dharmjeet.kumar at mahindracomviva.com Thu Apr 11 08:43:04 2013 From: dharmjeet.kumar at mahindracomviva.com (Dharmjeet Kumar) Date: Thu, 11 Apr 2013 06:43:04 +0000 Subject: [python-win32] Extract Comma Separated Currency Value (not Date) from given file. Message-ID: <8BEF733BFFE5394E91175D77CAF900150B764F1A@comv-mbx2-ggn.COMVIVA.COM> Objective: Extract Currency Value (not Date) from given file. Content of file: [["1234567890","Your previous month point is QR 5,200.33.Your current month point is QR 1,15,200.33, Last Year total point earned QR 5589965.26 and point lost in game is QR -11520 your this year subscription will expire on 19-04-2013. 9. Back"]] What I have done so far: def read_file(): fp = open('D:\\ReadData2.txt', 'rb') content = fp.read() data = eval(content) l1 = ["%s" % x[1] for x in data] return l1 def check_currency(l2): import re for i in range(l2.__len__()): newstr2 = l2[i] val_currency = [] val_currency.extend(re.findall(r'([+-]?\d+(?:\,\d+)*?\d+(?:\.\d+)?)',newstr2)) print " List %s " % val_currency for i in range(len(val_currency)): val2 = val_currency[i] remove_commas = re.compile(r',(?=\d+)*?') val3 = remove_commas.sub('', val2) print val3 if __name__=="__main__":main() Ouput of check_currency: >List ['5,200.33', '1,15,200.33', '5589965.26', '-11520', '19', '-04', '-2013'] Expected Ouput of check_currency: List ['5,200.33', '1,15,200.33', '5589965.26', '-11520'] Problem with output: I am getting date in currency value which it should not. What alteration should I do in my regex to complete??? Thank You Regards Dharmjeet Kumar This e-mail and all material transmitted with it are for the use of the intended recipient(s) ONLY and contains confidential and/or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken pursuant to the contents of the present e-mail is strictly prohibited and is unlawful. The recipient acknowledges that Comviva Technologies Limited or its management or directors, are unable to exercise control or ensure the integrity over /of the contents of the information contained in e-mail. Any views expressed herein are those of the individual sender only and no binding nature of the contents shall be implied or assumed unless the sender does so expressly with due authority of Comviva Technologies Limited. E-mail and any contents transmitted with it are prone to viruses and related defects despite all efforts to avoid such by Comviva Technologies Limited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Thu Apr 11 19:49:10 2013 From: timr at probo.com (Tim Roberts) Date: Thu, 11 Apr 2013 10:49:10 -0700 Subject: [python-win32] Extract Comma Separated Currency Value (not Date) from given file. In-Reply-To: <8BEF733BFFE5394E91175D77CAF900150B764F1A@comv-mbx2-ggn.COMVIVA.COM> References: <8BEF733BFFE5394E91175D77CAF900150B764F1A@comv-mbx2-ggn.COMVIVA.COM> Message-ID: <5166F796.5030600@probo.com> Dharmjeet Kumar wrote: > > *Objective: * Extract Currency Value (not Date) from given file. > > ... > > *Problem with output: * I am getting date in currency value which it > should not. What alteration should I do in my regex to complete??? This is a tricky proposition. Your problem statement doesn't address a number of other special cases. For example, what about ++123,456.00 and --123? Should it match the +123,456.00 part and the -123 part? Or should those be completely ignored? What about "money+123,456"? What about "QR345.00"? If you think about this in words, you want to change your regular expression so that it doesn't match a sequence if the character immediate before could possibly have been part of a number, or if the character immediately following is a + or -. For that, you need a "negative lookbehind assertion" and a "negative lookahead assertion." So, if you add (? I am doing a major update to adodbapi, and have an ideal opportunity to add a new feature ... but I want to see whether it is a desirable feature... When reading data from database columns of decimal or date-time data, I return them to the user as Python decimal.decimal or datetime.datetime instances. I could do the same thing when reading of column of UUID data -- Windows data type adGUID -- and return it as an instance of the class "uuid". Would that be a good idea, or a bad idea? -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Sun Apr 14 13:55:16 2013 From: aahz at pythoncraft.com (Aahz) Date: Sun, 14 Apr 2013 04:55:16 -0700 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? In-Reply-To: References: Message-ID: <20130414115516.GA28891@panix.com> On Sun, Apr 14, 2013, Vernon D. Cole wrote: > > I am doing a major update to adodbapi, and have an ideal opportunity to add > a new feature ... but I want to see whether it is a desirable feature... > > When reading data from database columns of decimal or date-time data, I > return them to the user as Python decimal.decimal or datetime.datetime > instances. I could do the same thing when reading of column of UUID data > -- Windows data type adGUID -- and return it as an instance of the class > "uuid". > > Would that be a good idea, or a bad idea? Keeping in mind that I have zero experience with adodbapi and that most of my development experience has been more Linux-based (with a fair amount of general DB work), this certainly falls into the kind of behavior that I think would make using a framework easier, so +1 unless someone has a specific objection. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "In times like these, it helps to recall that there have always been times like these." --Paul Harvey From rupole at hotmail.com Mon Apr 15 18:04:28 2013 From: rupole at hotmail.com (Roger Upole) Date: Mon, 15 Apr 2013 12:04:28 -0400 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? References: Message-ID: I think the uuid module was introduced in python 2.5, might want to bear that in mind. Roger "Vernon D. Cole" wrote in message news:CAH-ZgAeC9D+=1UybyJrZtDob6bedJs8aYEHrMqp-iyFWonmf+w at mail.gmail.com... >I am doing a major update to adodbapi, and have an ideal opportunity to add > a new feature ... but I want to see whether it is a desirable feature... > > When reading data from database columns of decimal or date-time data, I > return them to the user as Python decimal.decimal or datetime.datetime > instances. I could do the same thing when reading of column of UUID data > -- Windows data type adGUID -- and return it as an instance of the class > "uuid". > > Would that be a good idea, or a bad idea? > -- > Vernon Cole > -------------------------------------------------------------------------------- > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From vernondcole at gmail.com Mon Apr 15 18:10:40 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Mon, 15 Apr 2013 10:10:40 -0600 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? In-Reply-To: References: Message-ID: I thought Mark approved dropping 2.4. Did I misunderstand? -- Vernon On Mon, Apr 15, 2013 at 10:04 AM, Roger Upole wrote: > I think the uuid module was introduced in python 2.5, might want to bear > that in mind. > > Roger > > "Vernon D. Cole" wrote in message > news:CAH-ZgAeC9D+=1UybyJrZtDob6bedJs8aYEHrMqp-iyFWonmf+w at mail.gmail.com... > >I am doing a major update to adodbapi, and have an ideal opportunity to > add > > a new feature ... but I want to see whether it is a desirable feature... > > > > When reading data from database columns of decimal or date-time data, I > > return them to the user as Python decimal.decimal or datetime.datetime > > instances. I could do the same thing when reading of column of UUID data > > -- Windows data type adGUID -- and return it as an instance of the class > > "uuid". > > > > Would that be a good idea, or a bad idea? > > -- > > Vernon Cole > > > > > > -------------------------------------------------------------------------------- > > > > _______________________________________________ > > python-win32 mailing list > > python-win32 at python.org > > http://mail.python.org/mailman/listinfo/python-win32 > > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupole at hotmail.com Mon Apr 15 18:26:53 2013 From: rupole at hotmail.com (Roger Upole) Date: Mon, 15 Apr 2013 12:26:53 -0400 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? References: Message-ID: Dropping 2.4 was mentioned, but only in the context if it used vc6. (It's build with VC7.) Roger "Vernon D. Cole" wrote in message news:CAH-ZgAdRVmyO3EtwrYzgug_jvN1K57J=veQhkG0Y+Hs8KjV2Fg at mail.gmail.com... >I thought Mark approved dropping 2.4. Did I misunderstand? > -- > Vernon > > > On Mon, Apr 15, 2013 at 10:04 AM, Roger Upole wrote: > >> I think the uuid module was introduced in python 2.5, might want to bear >> that in mind. >> >> Roger >> >> "Vernon D. Cole" wrote in message >> news:CAH-ZgAeC9D+=1UybyJrZtDob6bedJs8aYEHrMqp-iyFWonmf+w at mail.gmail.com... >> >I am doing a major update to adodbapi, and have an ideal opportunity to >> add >> > a new feature ... but I want to see whether it is a desirable feature... >> > >> > When reading data from database columns of decimal or date-time data, I >> > return them to the user as Python decimal.decimal or datetime.datetime >> > instances. I could do the same thing when reading of column of UUID data >> > -- Windows data type adGUID -- and return it as an instance of the class >> > "uuid". >> > >> > Would that be a good idea, or a bad idea? >> > -- >> > Vernon Cole >> > >> >> >> >> -------------------------------------------------------------------------------- >> >> >> > _______________________________________________ >> > python-win32 mailing list >> > python-win32 at python.org >> > http://mail.python.org/mailman/listinfo/python-win32 >> > >> >> >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> > -------------------------------------------------------------------------------- > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From skippy.hammond at gmail.com Tue Apr 16 01:35:55 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Tue, 16 Apr 2013 09:35:55 +1000 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? In-Reply-To: References: Message-ID: <516C8EDB.4060104@gmail.com> FWIW, the most recent build of pywin32 has had less 2.4 downloads (15) than 2.3 (23), so dropping 2.4 can certainly be done as soon as there is some concrete advantage. [hrm - but those download figures are suspect - I'm guessing sourceforge has recently reset them - but I think 2.4 is as "dead" as 2.3 is for most people] Mark On 16/04/2013 2:26 AM, Roger Upole wrote: > Dropping 2.4 was mentioned, but only in the context if it used vc6. (It's build with VC7.) > > Roger > > "Vernon D. Cole" wrote in message news:CAH-ZgAdRVmyO3EtwrYzgug_jvN1K57J=veQhkG0Y+Hs8KjV2Fg at mail.gmail.com... >> I thought Mark approved dropping 2.4. Did I misunderstand? >> -- >> Vernon >> >> >> On Mon, Apr 15, 2013 at 10:04 AM, Roger Upole wrote: >> >>> I think the uuid module was introduced in python 2.5, might want to bear >>> that in mind. >>> >>> Roger >>> >>> "Vernon D. Cole" wrote in message >>> news:CAH-ZgAeC9D+=1UybyJrZtDob6bedJs8aYEHrMqp-iyFWonmf+w at mail.gmail.com... >>>> I am doing a major update to adodbapi, and have an ideal opportunity to >>> add >>>> a new feature ... but I want to see whether it is a desirable feature... >>>> >>>> When reading data from database columns of decimal or date-time data, I >>>> return them to the user as Python decimal.decimal or datetime.datetime >>>> instances. I could do the same thing when reading of column of UUID data >>>> -- Windows data type adGUID -- and return it as an instance of the class >>>> "uuid". >>>> >>>> Would that be a good idea, or a bad idea? >>>> -- >>>> Vernon Cole From mmanfre at gmail.com Tue Apr 16 01:52:37 2013 From: mmanfre at gmail.com (Michael Manfre) Date: Mon, 15 Apr 2013 19:52:37 -0400 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? In-Reply-To: <516C8EDB.4060104@gmail.com> References: <516C8EDB.4060104@gmail.com> Message-ID: Aside from the well known benefits of dropping a python version that is two versions behind the "security patches only" release, cleaner code with the try..except..finally and with changes, and also the ability of Vernon to use the uuid object in adodbapi. Regards, Michael Manfre On Mon, Apr 15, 2013 at 7:35 PM, Mark Hammond wrote: > FWIW, the most recent build of pywin32 has had less 2.4 downloads (15) > than 2.3 (23), so dropping 2.4 can certainly be done as soon as there is > some concrete advantage. > > [hrm - but those download figures are suspect - I'm guessing sourceforge > has recently reset them - but I think 2.4 is as "dead" as 2.3 is for most > people] > > Mark > > > On 16/04/2013 2:26 AM, Roger Upole wrote: > >> Dropping 2.4 was mentioned, but only in the context if it used vc6. (It's >> build with VC7.) >> >> Roger >> >> "Vernon D. Cole" wrote in message >> news:CAH-ZgAdRVmyO3EtwrYzgug_**jvN1K57J=veQhkG0Y+Hs8KjV2Fg@** >> mail.gmail.com... >> >>> I thought Mark approved dropping 2.4. Did I misunderstand? >>> -- >>> Vernon >>> >>> >>> On Mon, Apr 15, 2013 at 10:04 AM, Roger Upole >>> wrote: >>> >>> I think the uuid module was introduced in python 2.5, might want to bear >>>> that in mind. >>>> >>>> Roger >>>> >>>> "Vernon D. Cole" wrote in message >>>> news:CAH-ZgAeC9D+=**1UybyJrZtDob6bedJs8aYEHrMqp-** >>>> iyFWonmf+w at mail.gmail.com... >>>> >>>>> I am doing a major update to adodbapi, and have an ideal opportunity to >>>>> >>>> add >>>> >>>>> a new feature ... but I want to see whether it is a desirable >>>>> feature... >>>>> >>>>> When reading data from database columns of decimal or date-time data, I >>>>> return them to the user as Python decimal.decimal or datetime.datetime >>>>> instances. I could do the same thing when reading of column of UUID >>>>> data >>>>> -- Windows data type adGUID -- and return it as an instance of the >>>>> class >>>>> "uuid". >>>>> >>>>> Would that be a good idea, or a bad idea? >>>>> -- >>>>> Vernon Cole >>>>> >>>> > ______________________________**_________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/**mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Tue Apr 16 05:58:35 2013 From: aahz at pythoncraft.com (Aahz) Date: Mon, 15 Apr 2013 20:58:35 -0700 Subject: [python-win32] survey question: should data from database columns of type "adGUID" be returned as instances of class "uuid"? In-Reply-To: <516C8EDB.4060104@gmail.com> References: <516C8EDB.4060104@gmail.com> Message-ID: <20130416035835.GA22101@panix.com> On Tue, Apr 16, 2013, Mark Hammond wrote: > > FWIW, the most recent build of pywin32 has had less 2.4 downloads > (15) than 2.3 (23), so dropping 2.4 can certainly be done as soon as > there is some concrete advantage. Remember that people with old Python versions will still be able to download old builds -- the only question is whether they should receive the benefits of new builds. I do recommend clearly segregating and labeling builds to avoid confusion. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "In times like these, it helps to recall that there have always been times like these." --Paul Harvey From vernondcole at gmail.com Thu Apr 18 13:09:36 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 18 Apr 2013 05:09:36 -0600 Subject: [python-win32] Python 3 --> Can't pickle Message-ID: Help me, Obiwan Kanobi... I have been tracking this one down, for two days, and have cleaned by my data conversion routines and the documentation for them as a result. but I can't determine the "right" way to fix this. This works fine in Python 2, but in Python 3, the class of a datetime retrieved from COM is different. I can send them across a PyRO link in Python 2, when I try it in Python 3 I get: the error: adodbapi.apibase.DatabaseError: Can't pickle : attribute lookup pywintypes.datetime failed The conversion code I use is: def DateObjectFromCOMDate(self,comDate): if isinstance(comDate,datetime.datetime): return comDate.replace(tzinfo=None) # make non aware Which returns a pywintypes.datetime, which, as you see, will not pickle. Any suggestions? -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Thu Apr 18 17:15:42 2013 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 18 Apr 2013 16:15:42 +0100 Subject: [python-win32] Python 3 --> Can't pickle In-Reply-To: References: Message-ID: <51700E1E.7020609@timgolden.me.uk> On 18/04/2013 12:09, Vernon D. Cole wrote: > Help me, Obiwan Kanobi... > > I have been tracking this one down, for two days, and have cleaned by my > data conversion routines and the documentation for them as a result. but > I can't determine the "right" way to fix this. > > This works fine in Python 2, but in Python 3, the class of a datetime > retrieved from COM is different. I can send them across a PyRO link in > Python 2, when I try it in Python 3 I get: the error: > > adodbapi.apibase.DatabaseError: Can't pickle 'pywintypes.datetime'>: attribute lookup pywintypes.datetime failed > > The conversion code I use is: > > def DateObjectFromCOMDate(self,comDate): > if isinstance(comDate,datetime.datetime): > return comDate.replace(tzinfo=None) # make non aware > > Which returns a pywintypes.datetime, which, as you see, will not pickle. > > Any suggestions? Depends on how you're doing what you're doing, but could you serialise & unserialise before/after the Pyro call. eg generate to and from an iso date or an ordinal? (Obviously you'd have to do some work around the edges of Pyro to make it work, but for this datatype it should be feasible). TJG From dineshbvadhia at hotmail.com Thu Apr 18 19:51:02 2013 From: dineshbvadhia at hotmail.com (Dinesh B Vadhia) Date: Thu, 18 Apr 2013 10:51:02 -0700 Subject: [python-win32] pywin32 and virtualenv Message-ID: Hi! This is my first question on the list and not sure if this question has been asked as I can't find searchable archives. When developing 32-bit and 64-bit applications in respective virtualenv's, do pywin32-32 and pywin32-64 have to be installed in the respective virtualenv's? Or, are the two pywin32's installed system-wide? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupole at hotmail.com Thu Apr 18 23:26:03 2013 From: rupole at hotmail.com (Roger Upole) Date: Thu, 18 Apr 2013 17:26:03 -0400 Subject: [python-win32] Python 3 --> Can't pickle References: Message-ID: The pickle module is looking at the name of the class, and verifying that there's a module.class that matches. However, our subclass of datetime.datetime is registered in pywintypes' dict as TimeType instead. As a workaround, try pywintypes.datetime = pywintypes.TimeType Roger "Vernon D. Cole" wrote in message news:CAH-ZgAe7Lot7ng1mVU4figK0OBSbDRQqWtxUpgZ0CPg9WTbANQ at mail.gmail.com... > Help me, Obiwan Kanobi... > > I have been tracking this one down, for two days, and have cleaned by my > data conversion routines and the documentation for them as a result. but I > can't determine the "right" way to fix this. > > This works fine in Python 2, but in Python 3, the class of a datetime > retrieved from COM is different. I can send them across a PyRO link in > Python 2, when I try it in Python 3 I get: the error: > > adodbapi.apibase.DatabaseError: Can't pickle : > attribute lookup pywintypes.datetime failed > > The conversion code I use is: > > def DateObjectFromCOMDate(self,comDate): > if isinstance(comDate,datetime.datetime): > return comDate.replace(tzinfo=None) # make non aware > > Which returns a pywintypes.datetime, which, as you see, will not pickle. > > Any suggestions? > -- > Vernon > -------------------------------------------------------------------------------- > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From vernondcole at gmail.com Fri Apr 19 04:12:26 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 18 Apr 2013 20:12:26 -0600 Subject: [python-win32] pywin32 and virtualenv In-Reply-To: References: Message-ID: The installers will find the correct installation from the Windows registry, and will install in the correct place, side by side, system wide. I have installations varying from Python 2,3 to Python 3.3-64 on my laptop. Since installing Python 3.3, with its new Python loader, I have almost stopped using virtualenv, since I can easily pick my Python version from the command line: C:> py -3.2-32 myprog.py (But, of course, that is not the only reason for using virtualenv.) -- On Thu, Apr 18, 2013 at 11:51 AM, Dinesh B Vadhia wrote: > ** > Hi! This is my first question on the list and not sure if this question > has been asked as I can't find searchable archives. > > When developing 32-bit and 64-bit applications in respective virtualenv's, > do pywin32-32 and pywin32-64 have to be installed in the respective > virtualenv's? Or, are the two pywin32's installed system-wide? > > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dineshbvadhia at hotmail.com Fri Apr 19 11:19:04 2013 From: dineshbvadhia at hotmail.com (Dinesh B Vadhia) Date: Fri, 19 Apr 2013 02:19:04 -0700 Subject: [python-win32] pywin32 and virtualenv In-Reply-To: References: Message-ID: Ignoring virtualenv initially. On a Windows 8 machine, installed Python 2.7.4 64-bit system-wide. Installed Python 2.7.4 32-bit into a separate folder. Ran pywin32-218.win32-amd64--py2.7.exe successfully. Ran pywin32-218.win32-py2.7.exe in the Python 32-bit folder which generated the errors (shown in the pywin32 installer window): close failed in file object destructor: sys.excepthook is missing lost sys.stderr No mention of successful installation in installer window. From: Vernon D. Cole Sent: Thursday, April 18, 2013 7:12 PM To: Dinesh B Vadhia Cc: python-win32 at python.org Subject: Re: [python-win32] pywin32 and virtualenv The installers will find the correct installation from the Windows registry, and will install in the correct place, side by side, system wide. I have installations varying from Python 2,3 to Python 3.3-64 on my laptop. Since installing Python 3.3, with its new Python loader, I have almost stopped using virtualenv, since I can easily pick my Python version from the command line: C:> py -3.2-32 myprog.py (But, of course, that is not the only reason for using virtualenv.) -- On Thu, Apr 18, 2013 at 11:51 AM, Dinesh B Vadhia wrote: Hi! This is my first question on the list and not sure if this question has been asked as I can't find searchable archives. When developing 32-bit and 64-bit applications in respective virtualenv's, do pywin32-32 and pywin32-64 have to be installed in the respective virtualenv's? Or, are the two pywin32's installed system-wide? _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Mon Apr 22 04:44:19 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 22 Apr 2013 12:44:19 +1000 Subject: [python-win32] pywin32 and virtualenv In-Reply-To: References: Message-ID: <5174A403.8050706@gmail.com> On 19/04/2013 7:19 PM, Dinesh B Vadhia wrote: > Ignoring virtualenv initially. > On a Windows 8 machine, installed Python 2.7.4 64-bit system-wide. > Installed Python 2.7.4 32-bit into a separate folder. > Ran pywin32-218.win32-amd64--py2.7.exe successfully. > Ran pywin32-218.win32-py2.7.exe in the Python 32-bit folder which > generated the errors (shown in the pywin32 installer window): > close failed in file object destructor: > sys.excepthook is missing > lost sys.stderr > No mention of successful installation in installer window. I believe this is caused by having UAC disabled on the machine - and I've never found why this happens. Running "python pywin32_postinstall.py -install" manually should complete the installation. HTH, Mark > > *From:* Vernon D. Cole > *Sent:* Thursday, April 18, 2013 7:12 PM > *To:* Dinesh B Vadhia > *Cc:* python-win32 at python.org > *Subject:* Re: [python-win32] pywin32 and virtualenv > > The installers will find the correct installation from the Windows > registry, and will install in the correct place, side by side, system > wide. I have installations varying from Python 2,3 to Python 3.3-64 on > my laptop. > > Since installing Python 3.3, with its new Python loader, I have almost > stopped using virtualenv, since I can easily pick my Python version from > the command line: > C:> py -3.2-32 myprog.py > (But, of course, that is not the only reason for using virtualenv.) > -- > > > > On Thu, Apr 18, 2013 at 11:51 AM, Dinesh B Vadhia > > wrote: > > __ > Hi! This is my first question on the list and not sure if this > question has been asked as I can't find searchable archives. > When developing 32-bit and 64-bit applications in respective > virtualenv's, do pywin32-32 and pywin32-64 have to be installed in > the respective virtualenv's? Or, are the two pywin32's installed > system-wide? > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From dineshbvadhia at hotmail.com Thu Apr 25 11:59:52 2013 From: dineshbvadhia at hotmail.com (Dinesh B Vadhia) Date: Thu, 25 Apr 2013 02:59:52 -0700 Subject: [python-win32] python-win32 Digest, Vol 121, Issue 12 In-Reply-To: References: Message-ID: Mark Started again from the top by first downloading the pywin32 tarball to a Windows 7/8 64-bit machine with Python 2.7.4 64-bit installed system-wide. The MS SDK v7.0 has been installed and initiated for 64-bit compiler support. No virtualenv during this phase. The following is the output for installing pywin32 followed by installing with pywin32_postinstall: 1. C:\Downloads\pywin32-218>python setup.py install Building pywin32 2.7.218.0 running install running build running build_py running build_ext Found version 0x601 in C:\Program Files\Microsoft SDKs\Windows\v7.0\include\SDKDDKVER.H building 'perfmondata' extension C:\Program Files\Microsoft SDKs\Windows\v7.0\bin\x64\mc.exe -h win32\src\perfmon -r build\temp.win-amd64-2.7\Release\win32\src\perfmon win32\src\perfmon\PyPerfM sgs.mc MC: Compiling win32\src\perfmon\PyPerfMsgs.mc C:\Program Files\Microsoft SDKs\Windows\v7.0\bin\x64\rc.exe /fobuild\temp.win-am d64-2.7\Release\win32\src\perfmon\PyPerfMsgs.res build\temp.win-amd64-2.7\Releas e\win32\src\perfmon\PyPerfMsgs.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385 Copyright (C) Microsoft Corporation. All rights reserved. C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nolog o /Ox /MD /W3 /GS- /DNDEBUG -DDISTUTILS_BUILD -D_CRT_SECURE_NO_WARNINGS -Icom/wi n32com/src/include -Iwin32/src -IC:\Python27\include -IC:\Python27\PC "-IC:\Prog ram Files\Microsoft SDKs\Windows\v7.0\include" /Tpwin32\src\perfmon\perfmondata. cpp /Fobuild\temp.win-amd64-2.7\Release\win32\src\perfmon\perfmondata.obj /Zi /F dbuild\temp.win-amd64-2.7\Release\perfmondata_vc.pdb /EHsc /DUNICODE /D_UNICODE /DWINNT perfmondata.cpp win32\src\perfmon\perfmondata.cpp(11) : fatal error C1083: Cannot open include f ile: 'perfutil.h': No such file or directory error: command 'cl.exe' failed with exit status 2 2. C:\Downloads\pywin32-218>python pywin32_postinstall.py -in stall Traceback (most recent call last): File "pywin32_postinstall.py", line 615, in install() File "pywin32_postinstall.py", line 323, in install import win32api ImportError: DLL load failed: %1 is not a valid Win32 application. -------------------------------------------------- From: Sent: Monday, April 22, 2013 3:00 AM To: Subject: python-win32 Digest, Vol 121, Issue 12 > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Re: pywin32 and virtualenv (Mark Hammond) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 22 Apr 2013 12:44:19 +1000 > From: Mark Hammond > To: Dinesh B Vadhia , > python-win32 at python.org > Subject: Re: [python-win32] pywin32 and virtualenv > Message-ID: <5174A403.8050706 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 19/04/2013 7:19 PM, Dinesh B Vadhia wrote: >> Ignoring virtualenv initially. >> On a Windows 8 machine, installed Python 2.7.4 64-bit system-wide. >> Installed Python 2.7.4 32-bit into a separate folder. >> Ran pywin32-218.win32-amd64--py2.7.exe successfully. >> Ran pywin32-218.win32-py2.7.exe in the Python 32-bit folder which >> generated the errors (shown in the pywin32 installer window): >> close failed in file object destructor: >> sys.excepthook is missing >> lost sys.stderr >> No mention of successful installation in installer window. > > I believe this is caused by having UAC disabled on the machine - and > I've never found why this happens. Running "python > pywin32_postinstall.py -install" manually should complete the > installation. > > HTH, > > Mark >> >> *From:* Vernon D. Cole >> *Sent:* Thursday, April 18, 2013 7:12 PM >> *To:* Dinesh B Vadhia >> *Cc:* python-win32 at python.org >> *Subject:* Re: [python-win32] pywin32 and virtualenv >> >> The installers will find the correct installation from the Windows >> registry, and will install in the correct place, side by side, system >> wide. I have installations varying from Python 2,3 to Python 3.3-64 on >> my laptop. >> >> Since installing Python 3.3, with its new Python loader, I have almost >> stopped using virtualenv, since I can easily pick my Python version from >> the command line: >> C:> py -3.2-32 myprog.py >> (But, of course, that is not the only reason for using virtualenv.) >> -- >> >> >> >> On Thu, Apr 18, 2013 at 11:51 AM, Dinesh B Vadhia >> > wrote: >> >> __ >> Hi! This is my first question on the list and not sure if this >> question has been asked as I can't find searchable archives. >> When developing 32-bit and 64-bit applications in respective >> virtualenv's, do pywin32-32 and pywin32-64 have to be installed in >> the respective virtualenv's? Or, are the two pywin32's installed >> system-wide? >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> >> >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > ------------------------------ > > End of python-win32 Digest, Vol 121, Issue 12 > ********************************************* > From vernondcole at gmail.com Thu Apr 25 12:09:20 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 25 Apr 2013 04:09:20 -0600 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: <515380E6.1090905@gmail.com> References: <5151967F.3020006@gmail.com> <515380E6.1090905@gmail.com> Message-ID: This has also been discussed in the GUID thread, but I am bringing it back to this one... I have basically completed the work of breaking adodbapi up into a package of smaller modules. It has really helped to make the code more readable. There is now a "remote" module, so that a programmer (on Windows or Linux) can do: import adodbapi.remote as db conn = db.connect('some connection string") and expect the resulting connection to operate pretty much as if it were a local database connection. There is also a server module: C:>py -m adodbapi.server host=0.0.0.0 Tearing the old monolithic module apart was key to making those happen. But now I am having trouble getting the legacy code in the test suite to handle some obscure cases. The easiest way out of my problem requires the use of explicit relative imports -- which were introduced in Python 2.5. Can we (please) drop 2.4? -- Vernon (P.S.: the "remote" and "server" modules require Pyro4, which in turn requires Python 2.6) I have carefully isolated the prerequisites so that they do not appear unless you try actually using the new routines.) On Wed, Mar 27, 2013 at 5:29 PM, Mark Hammond wrote: > On 28/03/2013 5:18 AM, Roger Upole wrote: > >> Python 2.4 is VS.Net 2003 (aka VC7). >> >> If we can drop support for Windows 95/98/ME while we're >> at it, it would eliminate some more maintenance headaches. >> At this point in time, even dropping Windows NT isn't unreasonable. >> > > Agreed. > > Mark > > > >> Roger >> >> "Mark Hammond" wrote in message >> news:5151967F.3020006 at gmail.**com... >> >>> I've been happy to drop support for a couple of years, but while it kept >>> working I kept building it :) I can't recall if 2.4 is >>> built with vc6 too - if so, we might as well kill that too. >>> >>> Cheers, >>> >>> Mark. >>> >>> >> >> >> ______________________________**_________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> > ______________________________**_________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/**mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Thu Apr 25 12:27:12 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 25 Apr 2013 04:27:12 -0600 Subject: [python-win32] pywin32 and virtualenv Message-ID: Dinesh: Unless you plan on modifying the C language code of pywin32, or need to add C language routines of your own, there is absolutely no advantage in building pywin32 from source. In almost all cases you are better off downloading the pre-built installers. (( If you ARE one of those rare C programmers, please forgive me for speaking up. )) -- Vernon On Thu, Apr 25, 2013 at 3:59 AM, Dinesh B Vadhia wrote: > Re: [python-win32] pywin32 and virtualenv -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Fri Apr 26 01:39:46 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 25 Apr 2013 17:39:46 -0600 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: References: <5151967F.3020006@gmail.com> <515380E6.1090905@gmail.com> Message-ID: My apologies for publishing misinformation: Pyro4 does not *require* Python 2.6, it simply does not go out of it's way to support 2.5. In fact, it does work. I have discovered that the 2.6 dependencies were in my own code for the server and remote modules & fixed them. I had to write a main program to run the server. It follows in full... #!python2.5 """ Python 2.5 will not run the server using "py -2.5 -m adodbapi.server" but will run it this way""" import adodbapi.server adodbapi.server.serve() So -- I was wrong. The new features I am adding to adodbapi will work in Python 2.5, and passed unittest a few minutes ago. 2.4 support is hopeless. -- Vernon On Thu, Apr 25, 2013 at 4:09 AM, Vernon D. Cole wrote: > > > (P.S.: the "remote" and "server" modules require Pyro4, which in turn > requires Python 2.6) I have carefully isolated the prerequisites so that > they do not appear unless you try actually using the new routines.) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Fri Apr 26 07:20:20 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Fri, 26 Apr 2013 15:20:20 +1000 Subject: [python-win32] python-win32 Digest, Vol 121, Issue 12 In-Reply-To: References: Message-ID: <517A0E94.1040608@gmail.com> Can't you just download and install the pre-built binaries? If you do need to build from sources, I suspect the missing header is in the platform SDK... Mark On 25/04/2013 7:59 PM, Dinesh B Vadhia wrote: > Mark > Started again from the top by first downloading the pywin32 tarball to a > Windows 7/8 64-bit machine with Python 2.7.4 64-bit installed > system-wide. The MS SDK v7.0 has been installed and initiated for 64-bit > compiler support. No virtualenv during this phase. The following is > the output for installing pywin32 followed by installing with > pywin32_postinstall: > > 1. > C:\Downloads\pywin32-218>python setup.py install > Building pywin32 2.7.218.0 > running install > running build > running build_py > running build_ext > Found version 0x601 in C:\Program Files\Microsoft > SDKs\Windows\v7.0\include\SDKDDKVER.H > building 'perfmondata' extension > C:\Program Files\Microsoft SDKs\Windows\v7.0\bin\x64\mc.exe -h > win32\src\perfmon > -r build\temp.win-amd64-2.7\Release\win32\src\perfmon > win32\src\perfmon\PyPerfM > sgs.mc > MC: Compiling win32\src\perfmon\PyPerfMsgs.mc > C:\Program Files\Microsoft SDKs\Windows\v7.0\bin\x64\rc.exe > /fobuild\temp.win-am > d64-2.7\Release\win32\src\perfmon\PyPerfMsgs.res > build\temp.win-amd64-2.7\Releas > e\win32\src\perfmon\PyPerfMsgs.rc > Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385 > Copyright (C) Microsoft Corporation. All rights reserved. > > C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe > /c /nolog > o /Ox /MD /W3 /GS- /DNDEBUG -DDISTUTILS_BUILD -D_CRT_SECURE_NO_WARNINGS > -Icom/wi > n32com/src/include -Iwin32/src -IC:\Python27\include -IC:\Python27\PC > "-IC:\Prog > ram Files\Microsoft SDKs\Windows\v7.0\include" > /Tpwin32\src\perfmon\perfmondata. > cpp > /Fobuild\temp.win-amd64-2.7\Release\win32\src\perfmon\perfmondata.obj > /Zi /F > dbuild\temp.win-amd64-2.7\Release\perfmondata_vc.pdb /EHsc /DUNICODE > /D_UNICODE > /DWINNT > perfmondata.cpp > win32\src\perfmon\perfmondata.cpp(11) : fatal error C1083: Cannot open > include f > ile: 'perfutil.h': No such file or directory > error: command 'cl.exe' failed with exit status 2 > > 2. > C:\Downloads\pywin32-218>python pywin32_postinstall.py -in > stall > Traceback (most recent call last): > File "pywin32_postinstall.py", line 615, in > install() > File "pywin32_postinstall.py", line 323, in install > import win32api > ImportError: DLL load failed: %1 is not a valid Win32 application. > > > -------------------------------------------------- > From: > Sent: Monday, April 22, 2013 3:00 AM > To: > Subject: python-win32 Digest, Vol 121, Issue 12 > >> Send python-win32 mailing list submissions to >> python-win32 at python.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mail.python.org/mailman/listinfo/python-win32 >> or, via email, send a message with subject or body 'help' to >> python-win32-request at python.org >> >> You can reach the person managing the list at >> python-win32-owner at python.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of python-win32 digest..." >> >> >> Today's Topics: >> >> 1. Re: pywin32 and virtualenv (Mark Hammond) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 22 Apr 2013 12:44:19 +1000 >> From: Mark Hammond >> To: Dinesh B Vadhia , >> python-win32 at python.org >> Subject: Re: [python-win32] pywin32 and virtualenv >> Message-ID: <5174A403.8050706 at gmail.com> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> On 19/04/2013 7:19 PM, Dinesh B Vadhia wrote: >>> Ignoring virtualenv initially. >>> On a Windows 8 machine, installed Python 2.7.4 64-bit system-wide. >>> Installed Python 2.7.4 32-bit into a separate folder. >>> Ran pywin32-218.win32-amd64--py2.7.exe successfully. >>> Ran pywin32-218.win32-py2.7.exe in the Python 32-bit folder which >>> generated the errors (shown in the pywin32 installer window): >>> close failed in file object destructor: >>> sys.excepthook is missing >>> lost sys.stderr >>> No mention of successful installation in installer window. >> >> I believe this is caused by having UAC disabled on the machine - and >> I've never found why this happens. Running "python >> pywin32_postinstall.py -install" manually should complete the >> installation. >> >> HTH, >> >> Mark >>> >>> *From:* Vernon D. Cole >>> *Sent:* Thursday, April 18, 2013 7:12 PM >>> *To:* Dinesh B Vadhia >>> *Cc:* python-win32 at python.org >>> *Subject:* Re: [python-win32] pywin32 and virtualenv >>> >>> The installers will find the correct installation from the Windows >>> registry, and will install in the correct place, side by side, system >>> wide. I have installations varying from Python 2,3 to Python 3.3-64 on >>> my laptop. >>> >>> Since installing Python 3.3, with its new Python loader, I have almost >>> stopped using virtualenv, since I can easily pick my Python version from >>> the command line: >>> C:> py -3.2-32 myprog.py >>> (But, of course, that is not the only reason for using virtualenv.) >>> -- >>> >>> >>> >>> On Thu, Apr 18, 2013 at 11:51 AM, Dinesh B Vadhia >>> > wrote: >>> >>> __ >>> Hi! This is my first question on the list and not sure if this >>> question has been asked as I can't find searchable archives. >>> When developing 32-bit and 64-bit applications in respective >>> virtualenv's, do pywin32-32 and pywin32-64 have to be installed in >>> the respective virtualenv's? Or, are the two pywin32's installed >>> system-wide? >>> >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >>> >>> >>> >>> >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >>> >> >> >> >> ------------------------------ >> >> Subject: Digest Footer >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> >> ------------------------------ >> >> End of python-win32 Digest, Vol 121, Issue 12 >> ********************************************* >> > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From vernondcole at gmail.com Sun Apr 28 23:51:55 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Sun, 28 Apr 2013 22:51:55 +0100 Subject: [python-win32] announcing Beta test of adodbapi v2.5 with Linux remote from Windows server data access Message-ID: I have tested this with Python 2.5 and up to 3.3. It tests well, but I would like to have a few other people look at it before committing to pywin32 release. This involved major re-factoring, so I may have missed something that the unit tests do not catch. Use of the server or remote sub-modules require Pyro4. Base module does not. -- Beta test is now available for adodbapi version 2.5 -- ADO is Microsoft's update for ODBC, and can be used to open almost any tabular data source in existance. I have personally used adodbapi to read tables from: SQL Server, PostgreSQL, MySQL, Jet (a.k.a. ACCESS), IBM DB2, Active Directory, and Excel. Dozens of other sources are possible. Since ADO is proprietary, this requires the user to be running Windows. I have added a new "remote" module which will run on a Linux computer, and allow a Windows computer to act as a "proxy" to make these data sources available using a db-api version 2 interface on Linux. The remote client has almost the same interface as the local adodbapi -- except that custom error handlers and custom variant conversions are not supported from the remote. In order to make this work, I had to do major surgery on the way adodbapi processes connection strings. (The complexity of a connection string is the price you pay for the power of the ADO connection engine.) I am happy to say that you can now follow the PEP-249 suggestion using the USER, PASSWORD, HOST, and DATABASE keywords (along with any others you wish to define) as arguments to the .connect() method. There are also connection keyword macros. Since the remote computer may not be aware of whether the server is running 64 bit or 32 bit Python (which require different ADO "Providers") the remote may send a macro to the server, allowing the server to choose the correct one. There are also connection keywords for PARAMSTYLE, AUTOCOMMIT, and TIMEOUT, which allow you to override those defaults at connection time. There is a new method for the connection object: .get_table_names() which returns a list of all the table names in your database. This works pretty much everywhere, and will even list the worksheets in a remote Excel spreadsheet. The beta will be available in a source zip file from https://sourceforge.net/projects/adodbapi/files/adodbapi/2.5.0/ A rough draft of documentation is supplied as an .odt file. Please, several people try this and look it over. If all goes well, in a few weeks it will be part of django-mssql. -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.Holtz at gmx.net Mon Apr 29 00:30:20 2013 From: A.Holtz at gmx.net (Andreas Holtz) Date: Mon, 29 Apr 2013 00:30:20 +0200 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: References: <5151967F.3020006@gmail.com> Message-ID: <517DA2FC.2070304@gmx.net> I'm bound to Python 2.5. I make heavy usage of 4Suite which is not supported for Python 2.6+ so I can not upgrade :( Or does anyone know a good XML lib that support xpath? Regards Andreas schrieb Michael Manfre am 26.03.2013 14:08: > Anyone running a no longer supported version of Python on Windows has already made the conscious decision that upgrading their code to newer > versions is not worth the cost. No point in shifting that cost to pywin32 maintenance. +1 on dropping all code from any version of Python > that no longer receives security updates. > > Regards, > Michael Manfre > > On Tue, Mar 26, 2013 at 8:44 AM, Kris Hardy > wrote: > > +1 > > Mark Hammond > wrote: > > I've been happy to drop support for a couple of years, but while it kept > working I kept building it :) I can't recall if 2.4 is built with vc6 > too - if so, we might as well kill that too. > > Cheers, > > Mark. > > On 26/03/2013 8:33 PM, Vernon D. Cole wrote: > > Perhaps it is time... > > I found a copy of Python 2.3 to load onto a new computer in order to > test my software, but it was not easy. It is in the small print about > four pages down from the download page on python.org > . I was one of 432 people who have downloaded the > 2.3 installer for pywin32 build 218. Compared with 121,351 downloaded > installers fo r Python 3.3 and 2.7 combined, 431 is 0.35 percent of our > users. I discounted myself, because the only reason I downloaded the > package was to make sure I have not broken something by using a new > feature. I wonder how many of the others of that 432 are for similar > reasons. Most, I would bet. > > Supporting that zero point three percent is costly, in terms of lost > features. Adodbapi is not a large module, but there are half a dozen > places in it which deal specifically with Python 2.3 -- such as "import > win32com.decimal.decimal_23 as decimal" for example. There are two > places which work around not having generator expressions, and a big > question in the comments about handling the difference between long and > int integers, and whether that is done correctly. There is also a > confusing code block for float conversion with commas versus dots. All > of that goes away if I simply change the "all versions of CPython lat er > than,,," line. > > The important differences in Python 2.4 > * decimal.Decimal > * generator expressions > * built in set objects > * Decorators > * unified integers > * locale-independent float/string conversion > * reverse iteration > > I am starting an informal poll... > > Is it really worthwhile to keep maintaining support for Python 2.3, > which was released in 2005 and has not been updated since 2008? > -- > Vernon > > > > > -------------------------------------------------------------------------------------------------------------------------------------------- > > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > > -------------------------------------------------------------------------------------------------------------------------------------------- > > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From amauryfa at gmail.com Mon Apr 29 00:38:03 2013 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Mon, 29 Apr 2013 00:38:03 +0200 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: <517DA2FC.2070304@gmx.net> References: <5151967F.3020006@gmail.com> <517DA2FC.2070304@gmx.net> Message-ID: 2013/4/29 Andreas Holtz > I'm bound to Python 2.5. > I make heavy usage of 4Suite which is not supported for Python 2.6+ so I > can not upgrade :( > Or does anyone know a good XML lib that support xpath? > Did you try lxml? It has good xpath support. And it's actively maintained. -- Amaury Forgeot d'Arc -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Mon Apr 29 00:38:32 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Sun, 28 Apr 2013 23:38:32 +0100 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: <517DA2FC.2070304@gmx.net> References: <5151967F.3020006@gmail.com> <517DA2FC.2070304@gmx.net> Message-ID: 2.5 is still good. I am suggesting (begging) that we drop 2.4 . On Apr 28, 2013 11:31 PM, "Andreas Holtz" wrote: > I'm bound to Python 2.5. > I make heavy usage of 4Suite which is not supported for Python 2.6+ so I > can not upgrade :( > Or does anyone know a good XML lib that support xpath? > > Regards > > Andreas > > schrieb Michael Manfre am 26.03.2013 14:08: > >> Anyone running a no longer supported version of Python on Windows has >> already made the conscious decision that upgrading their code to newer >> versions is not worth the cost. No point in shifting that cost to pywin32 >> maintenance. +1 on dropping all code from any version of Python >> that no longer receives security updates. >> >> Regards, >> Michael Manfre >> >> On Tue, Mar 26, 2013 at 8:44 AM, Kris Hardy > kris at rhs.com>> wrote: >> >> +1 >> >> Mark Hammond > *com >> wrote: >> >> I've been happy to drop support for a couple of years, but while >> it kept >> working I kept building it :) I can't recall if 2.4 is built with >> vc6 >> too - if so, we might as well kill that too. >> >> Cheers, >> >> Mark. >> >> On 26/03/2013 8:33 PM, Vernon D. Cole wrote: >> >> Perhaps it is time... >> >> I found a copy of Python 2.3 to load onto a new computer in >> order to >> test my software, but it was not easy. It is in the small >> print about >> four pages down from the download page on python.org < >> http://python.org> >> . I was one of 432 people who have >> downloaded the >> 2.3 installer for pywin32 build 218. Compared with 121,351 >> downloaded >> installers fo r Python 3.3 and 2.7 combined, 431 is 0.35 >> percent of our >> users. I discounted myself, because the only reason I >> downloaded the >> package was to make sure I have not broken something by using >> a new >> feature. I wonder how many of the others of that 432 are for >> similar >> reasons. Most, I would bet. >> >> Supporting that zero point three percent is costly, in terms >> of lost >> features. Adodbapi is not a large module, but there are half >> a dozen >> places in it which deal specifically with Python 2.3 -- such >> as "import >> win32com.decimal.decimal_23 as decimal" for example. There >> are two >> places which work around not having generator expressions, >> and a big >> question in the comments about handling the difference >> between long and >> int integers, and whether that is done correctly. There is >> also a >> confusing code block for float conversion with commas versus >> dots. All >> of that goes away if I simply change the "all versions of >> CPython lat er >> than,,," line. >> >> The important differences in Python 2.4 >> * decimal.Decimal >> * generator expressions >> * built in set objects >> * Decorators >> * unified integers >> * locale-independent float/string conversion >> * reverse iteration >> >> I am starting an informal poll... >> >> Is it really worthwhile to keep maintaining support for >> Python 2.3, >> which was released in 2005 and has not been updated since >> 2008? >> -- >> Vernon >> >> >> >> >> ------------------------------** >> ------------------------------**------------------------------** >> ------------------------------**-------------------- >> >> python-win32 mailing list >> python-win32 at python.org >> > >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> >> >> ------------------------------**------------------------------** >> ------------------------------**------------------------------** >> -------------------- >> >> python-win32 mailing list >> python-win32 at python.org >> > >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> >> -- >> Sent from my Android phone with K-9 Mail. Please excuse my brevity. >> >> ______________________________**_________________ >> python-win32 mailing list >> python-win32 at python.org >> > >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> >> >> >> ______________________________**_________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> ______________________________**_________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/**mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.Holtz at gmx.net Mon Apr 29 08:00:59 2013 From: A.Holtz at gmx.net (Andreas Holtz) Date: Mon, 29 Apr 2013 08:00:59 +0200 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: References: <5151967F.3020006@gmail.com> <517DA2FC.2070304@gmx.net> Message-ID: <517E0C9B.9060208@gmx.net> I didn't check it but will have a look. Thank you very much :) Andreas schrieb Amaury Forgeot d'Arc am 29.04.2013 00:38: > > 2013/4/29 Andreas Holtz > > > I'm bound to Python 2.5. > I make heavy usage of 4Suite which is not supported for Python 2.6+ so I can not upgrade :( > Or does anyone know a good XML lib that support xpath? > > > Did you try lxml? It has good xpath support. > And it's actively maintained. > > -- > Amaury Forgeot d'Arc From werner.bruhin at free.fr Mon Apr 29 10:34:18 2013 From: werner.bruhin at free.fr (Werner F. Bruhin) Date: Mon, 29 Apr 2013 10:34:18 +0200 Subject: [python-win32] Dropping support for Python 2.3? In-Reply-To: <517DA2FC.2070304@gmx.net> References: <5151967F.3020006@gmail.com> <517DA2FC.2070304@gmx.net> Message-ID: On 29/04/2013 00:30, Andreas Holtz wrote: > I'm bound to Python 2.5. > I make heavy usage of 4Suite which is not supported for Python 2.6+ so I > can not upgrade :( > Or does anyone know a good XML lib that support xpath? What about Amara 2.x: https://pypi.python.org/pypi?%3Aaction=search&term=amara&submit=search Werner From hartmut.niemann at siemens.com Mon Apr 29 18:21:51 2013 From: hartmut.niemann at siemens.com (Niemann, Hartmut) Date: Mon, 29 Apr 2013 18:21:51 +0200 Subject: [python-win32] Excel + pyinstaller: missing a constant: xlTopToBottom Message-ID: Hello! The following snippet from win32com.client import constants as xl_constants wbook.ActiveSheet.Range('A3:N' + str(row + 1)).Sort( Key1 = wbook.ActiveSheet.Range('B3'), Orientation = xl_constants.xlTopToBottom, DataOption1 = xl_constants.xlSortTextAsNumbers ) from a script that is exe-fied with pyinstaller fails with Traceback (most recent call last): File "", line 502, in process_chain File "", line 451, in process_project File "", line 330, in create_fg File "D:\temp\lib_chain\out00-PYZ.pyz\win32com.client", line 170, in __getattr__ AttributeError: xlTopToBottom Is this a pywin problem? Do we need to instruct pyinstaller to work differently to cooperate with Excel? Any ideas? (This is python 2.7.3 on Windows XP) Mit freundlichen Gr??en Dr. Hartmut Niemann Siemens AG Infrastructure & Cities Sector Rail Systems Division Locomotives and Components IC RL LOC EN LE 8 Werner-von-Siemens-Str. 67 91052 Erlangen, Deutschland Tel.: +49 9131 7-34264 Fax: +49 9131 7-26254 mailto:hartmut.niemann at siemens.com Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme; Vorstand: Peter L?scher, Vorsitzender; Roland Busch, Brigitte Ederer, Klaus Helmrich, Joe Kaeser, Barbara Kux, Hermann Requardt, Siegfried Russwurm, Peter Y. Solmssen, Michael S??; Sitz der Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cwg at falma.de Tue Apr 30 01:51:10 2013 From: cwg at falma.de (Christoph Groth) Date: Tue, 30 Apr 2013 01:51:10 +0200 Subject: [python-win32] Cython-generated module crashes after importing C++-extension compiled with MinGW Message-ID: <87bo8wsxox.fsf@falma.de> Hi, We've developed a (BSD licensed) computational Physics package for Python that is to be released in the coming days. It works flawlessly on unixish systems. I have, however, considerable problems trying to make it to work under Windows as well. (I'm using Windows XP SP3 inside a virtual machine.) I've managed to make the package actually work, but upon exit of a Python script that imported it, the following message is shown: "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." I have managed to bring down the problem to a small test-case, a directory with three files: **************** problem.cc **************** #include PyMethodDef functions[] = {{0, 0, 0, 0}}; extern "C" void initproblem() { PyObject* m = Py_InitModule("problem", functions); } **************** setup.py **************** from distutils.core import setup, Extension module = Extension('problem', language='c++', sources=['problem.cc']) setup(name='problem', version='0.0', ext_modules=[module]) **************** test.pyx **************** import problem ******************************** I build and install the package with "python setup.py build" and "python setup.py install" using the following software: * Python 2.7.4 from http://python.org/ * MinGW 3.20 (gcc 4.6.2), installed using mingw-get-inst-20120426.exe This works and the module "problem" _can_ be imported from within a Python interpreter. Importing from a cython-generated executable, however, fails: When I build test.pyx using cython --embed -a test.pyx (with Cython 0.19 on linux) gcc -IC:\Python27\include -LC:\Python27\libs test.c -lpython27 (on windows) and run the resulting executable a.exe, I get the error message quoted above. Strangely, changing "language='c++'" to "language='c'" in setup.py fixes this problem. However, this is not a viable solution as it only works for the toy-example. (The real module uses C++-features like templates heavily. We are using it in our large Python package that contains Cython-generated modules.) Does anyone have a clue how this issue could be resolved? Any help is greatly appreciated! Christoph PS. Because this problem is very urgent to us, I am posting this to cython-users at googlegroups.com as well. From skippy.hammond at gmail.com Tue Apr 30 06:09:24 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Tue, 30 Apr 2013 14:09:24 +1000 Subject: [python-win32] Excel + pyinstaller: missing a constant: xlTopToBottom In-Reply-To: References: Message-ID: <517F43F4.50902@gmail.com> On 30/04/2013 2:21 AM, Niemann, Hartmut wrote: > Hello! > The following snippet > from win32com.client import constants as xl_constants > wbook.ActiveSheet.Range('A3:N' + str(row + 1)).Sort( > Key1 = wbook.ActiveSheet.Range('B3'), > Orientation = xl_constants.xlTopToBottom, > DataOption1 = xl_constants.xlSortTextAsNumbers > ) The above works be leveraging "makepy" support - so something (either code not shown above, or by manually running makepy.py) has generated a file with the Excel object model, including the constants. > from a script that is exe-fied with pyinstaller fails with > Traceback (most recent call last): > File "", line 502, in process_chain > File "", line 451, in process_project > File "", line 330, in create_fg > File "D:\temp\lib_chain\out00-PYZ.pyz\win32com.client", line 170, in > __getattr__ > AttributeError: xlTopToBottom > Is this a pywin problem? Do we need to instruct pyinstaller to work > differently to cooperate with Excel? > Any ideas? > (This is python 2.7.3 on Windows XP) You need to tell pyinstaller to use makepy support for certain objects. py2exe has basic support for that, but I'm not familiar with pyinstaller to tell you how it might be done there - you probably need to find a pyinstaller mailing list and ask there. HTH, Mark > > Mit freundlichen Gr??en > Dr. Hartmut Niemann > > Siemens AG > Infrastructure & Cities Sector > Rail Systems Division > Locomotives and Components > IC RL LOC EN LE 8 > Werner-von-Siemens-Str. 67 > 91052 Erlangen, Deutschland > Tel.: +49 9131 7-34264 > Fax: +49 9131 7-26254 > mailto:hartmut.niemann at siemens.com > > Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard > Cromme; Vorstand: Peter L?scher, Vorsitzender; Roland Busch, Brigitte > Ederer, Klaus Helmrich, Joe Kaeser, Barbara Kux, Hermann Requardt, > Siegfried Russwurm, Peter Y. Solmssen, Michael S??; Sitz der > Gesellschaft: Berlin und M?nchen, Deutschland; Registergericht: Berlin > Charlottenburg, HRB 12300, M?nchen, HRB 6684; WEEE-Reg.-Nr. DE 23691322 > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From graham.bloice at trihedral.com Tue Apr 30 10:16:24 2013 From: graham.bloice at trihedral.com (Graham Bloice) Date: Tue, 30 Apr 2013 09:16:24 +0100 Subject: [python-win32] Cython-generated module crashes after importing C++-extension compiled with MinGW In-Reply-To: <87bo8wsxox.fsf@falma.de> References: <87bo8wsxox.fsf@falma.de> Message-ID: <2fef6e95c3aa9e48e47005a3319f4a67@mail.gmail.com> > -----Original Message----- > From: python-win32 [mailto:python-win32- > bounces+graham.bloice=trihedral.com at python.org] On Behalf Of Christoph > Groth > Sent: 30 April 2013 00:51 > To: python-win32 at python.org > Subject: [python-win32] Cython-generated module crashes after importing > C++-extension compiled with MinGW > > Hi, > > We've developed a (BSD licensed) computational Physics package for Python > that is to be released in the coming days. It works flawlessly on unixish > systems. I have, however, considerable problems trying to make it to work > under Windows as well. (I'm using Windows XP SP3 inside a virtual machine.) > > I've managed to make the package actually work, but upon exit of a Python > script that imported it, the following message is shown: > > "This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information." > > I have managed to bring down the problem to a small test-case, a directory > with three files: > > **************** problem.cc **************** #include > PyMethodDef functions[] = {{0, 0, 0, 0}}; > > extern "C" > void initproblem() > { > PyObject* m = Py_InitModule("problem", functions); } > **************** setup.py **************** from distutils.core > import setup, Extension module = Extension('problem', language='c++', > sources=['problem.cc']) setup(name='problem', version='0.0', > ext_modules=[module]) > **************** test.pyx **************** import problem > ******************************** > > I build and install the package with "python setup.py build" and "python > setup.py install" using the following software: > > * Python 2.7.4 from http://python.org/ > * MinGW 3.20 (gcc 4.6.2), installed using mingw-get-inst-20120426.exe > > This works and the module "problem" _can_ be imported from within a > Python interpreter. Importing from a cython-generated executable, > however, fails: When I build test.pyx using > > cython --embed -a test.pyx (with Cython 0.19 on linux) > gcc -IC:\Python27\include -LC:\Python27\libs test.c -lpython27 (on > windows) > > and run the resulting executable a.exe, I get the error message quoted > above. > > Strangely, changing "language='c++'" to "language='c'" in setup.py fixes this > problem. However, this is not a viable solution as it only works for the toy- > example. (The real module uses C++-features like templates heavily. We > are using it in our large Python package that contains Cython-generated > modules.) > > Does anyone have a clue how this issue could be resolved? Any help is > greatly appreciated! > [Graham Bloice said] Can you mix compilers with Python extensions, I thought you should (must) use the same compiler as the version of Python you are using is built with due to the compiler run-time library being used? See http://docs.python.org/2.7/extending/windows.html#using-dlls-in-practice From cwg at falma.de Tue Apr 30 12:12:25 2013 From: cwg at falma.de (Christoph Groth) Date: Tue, 30 Apr 2013 12:12:25 +0200 Subject: [python-win32] Cython-generated module crashes after importing C++-extension compiled with MinGW References: <87bo8wsxox.fsf@falma.de> <2fef6e95c3aa9e48e47005a3319f4a67@mail.gmail.com> Message-ID: <87k3nkiaye.fsf@falma.de> Graham Bloice writes: > Can you mix compilers with Python extensions, I thought you should (must) > use the same compiler as the version of Python you are using is built with > due to the compiler run-time library being used? See > http://docs.python.org/2.7/extending/windows.html#using-dlls-in-practice At least with MinGW it works: I've just found a work-around. (Cython is innocent here.) The problem appears when an extension compiled with gcc tries to import (by using Python's __import__) another extension compiled with g++. Both extensions can be imported from Python individually! My work-around for now is to compile and link everything with g++. I will look more into this soon. Does anyone have an idea why mixing gcc and g++ has these effects? It works on other platforms, so the code is OK.