From cappy2112 at gmail.com Sat Aug 1 01:37:38 2015 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 31 Jul 2015 16:37:38 -0700 Subject: [python-win32] argument passing problem on Windows 7 64-Bit Message-ID: Hello, I've got Python 2.7.10 64-Bit installed, via the Anaconda installer The path clearly shows C:\Anaconda in the path. Typing python by itself brings up the python REPL as expected. Running this simplified program easily illustrates the problem I'm seeing in another, larger Python program. http://pastebin.com/0bjBLgDh Running that script as: python cmdline.py 1 2 3 shows the expected output -> Cmd line args: ['cmdline.py', '1', '2', '3'] Running that script as -> cmdline.py 1 2 3 shows this output ->Cmd line args: 'C:\\Users\\tonycappellini\\Projects\\cmdline\\cmdline.py'] Searching for help yielded these, http://superuser.com/questions/429604/passing-arguments-to-a-python-script-file-association-not-found-windows-7-on-i https://technet.microsoft.com/en-us/library/bb490912.aspx I found that assoc .py showed this ->File type 'Python.File' not found or no open command associated with it ftype Python.file shows python.file="c:\Anaconda\python.exe" "%1" %* So, I've added this association for .py files assoc .py=Python.file and rebooted assoc .py now shows .py=Python.file However, arguments are still not being correctly passed to Python files. I am stumped by this issue, as it has never been a problem for me in the ~10 years that I've been using Python n Windows. I am working at a new job where all development systems use Windows 7 64-Bit. The systems at my previous place of employment used Windows 7 32-Bit, but I wouldn't expect this kind of problem from moving to a 64-But OS. I would appreciate some help understanding and fixing this issue, Thanks From trent at snakebite.org Sat Aug 1 02:39:18 2015 From: trent at snakebite.org (Trent Nelson) Date: Fri, 31 Jul 2015 20:39:18 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: References: <20150731201443.GB24500@trent.me> Message-ID: <20150801003917.GA34896@trent.me> On Fri, Jul 31, 2015 at 07:17:55PM -0400, Dennis Lee Bieber wrote: > On Fri, 31 Jul 2015 16:14:43 -0400, Trent Nelson > declaimed the following: > > >Hi folks, > > > >Bit off-topic, but just wanted to let people know about an experimental > >proof-of-concept fork of Python 3 I've been working on for the past > >couple of years called PyParallel: http://pyparallel.org. It essentially > >gets around the GIL limitations and allows Python code to run simultaneously > >in multiple threads from within a single interpreter/process. > > > The name might be a problem... The old pyserial library also had a > parallel port module pyParallel, and is the first hit on Google for > "pyparallel" Yeah that's definitely unfortunate... I found out about the old parallel port module with the same name after I'd settled on PyParallel. The website has only been up for a few days so I'm not surprised it's not ranking very high. > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfraed at ix.netcom.com HTTP://wlfraed.home.netcom.com/ Trent. From Paul_Koning at Dell.com Sat Aug 1 16:54:16 2015 From: Paul_Koning at Dell.com (Paul_Koning at Dell.com) Date: Sat, 1 Aug 2015 14:54:16 +0000 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <20150731201443.GB24500@trent.me> References: <20150731201443.GB24500@trent.me> Message-ID: <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> > On Jul 31, 2015, at 4:14 PM, Trent Nelson wrote: > > Hi folks, > > Bit off-topic, but just wanted to let people know about an experimental > proof-of-concept fork of Python 3 I've been working on for the past > couple of years called PyParallel: http://pyparallel.org. It essentially > gets around the GIL limitations and allows Python code to run simultaneously > in multiple threads from within a single interpreter/process. > > It's Windows only -- so I figured it might be of interest to this list. Impressive. Is the Windows only aspect because you used Windows proprietary thread APIs? Or because there is something special about Windows thread mechanisms that doesn?t carry over to, say, POSIX pthread? I assume the former, in other words it should be adaptable to standard thread architectures with some effort. paul From zachary.ware+pydev at gmail.com Sat Aug 1 06:01:15 2015 From: zachary.ware+pydev at gmail.com (Zachary Ware) Date: Fri, 31 Jul 2015 23:01:15 -0500 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <55BBE30A.8000304@comcast.net> References: <20150731201443.GB24500@trent.me> <55BBE30A.8000304@comcast.net> Message-ID: On Fri, Jul 31, 2015 at 4:05 PM, Bob Hood wrote: > Outstanding, Trent. Python's horrible multithreading support is something > that has really kept it from being used in serious environments. Your work > may not cover all platforms yet, but this is a great first step! I'd like to add a '[citation needed]' to your FUD here :). I think Youtube and CERN both qualify as 'serious environments' from at least two different perspectives. But that's a bit off-topic. Trent, is PyParallel still based on Python 3.3, and do you have any plans to rebase onto a newer branch at some point? -- Zach From trent at snakebite.org Mon Aug 3 02:10:19 2015 From: trent at snakebite.org (Trent Nelson) Date: Sun, 2 Aug 2015 20:10:19 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> References: <20150731201443.GB24500@trent.me> <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> Message-ID: <20150803001019.GB1474@trent.me> On Sat, Aug 01, 2015 at 02:54:16PM +0000, Paul_Koning at Dell.com wrote: > > > On Jul 31, 2015, at 4:14 PM, Trent Nelson > > wrote: > > > > Hi folks, > > > > Bit off-topic, but just wanted to let people know about an > > experimental proof-of-concept fork of Python 3 I've been working on > > for the past couple of years called PyParallel: > > http://pyparallel.org. It essentially gets around the GIL > > limitations and allows Python code to run simultaneously in multiple > > threads from within a single interpreter/process. > > > > It's Windows only -- so I figured it might be of interest to this > > list. > > Impressive. Is the Windows only aspect because you used Windows > proprietary thread APIs? Or because there is something special about > Windows thread mechanisms that doesn?t carry over to, say, POSIX > pthread? I assume the former, in other words it should be adaptable > to standard thread architectures with some effort. It's actually closer to the latter. I don't create a single thread with PyParallel -- I use the threadpool facilities exclusively. POSIX doesn't have anything like this -- the pthread abstraction is focused around the thread (the "worker"), not the work. (OS X has GCD, which comes close.) You *could* port PyParallel to POSIX, but you're either going to have to implement all the stuff Windows provides for free, which is a pretty big engineering effort. Even then, you're constrained by side-effects of the readiness-oriented I/O model (versus the completion-oriented model of Windows), so it becomes a lot harder to saturate all your I/O channels *and* peg all of your cores at 100% under load. (A typical multithreaded architecture will have a single thread dedicated to accept(), and then simply round-robin dispatch new FDs to a manual thread pool. A thread picks up the FD and adds it to its epoll/kqueue set -- that FD is now bound to that thread, which can quickly result in lop-sided resource allocation. The Windows I/O model revolves around the I/O request packet, which allows the "thread agnostic" separation between the I/O event (a write or read has completed) and the underlying thread used to handle the callback.) > paul Trent. From trent at snakebite.org Mon Aug 3 02:13:22 2015 From: trent at snakebite.org (Trent Nelson) Date: Sun, 2 Aug 2015 20:13:22 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: References: <20150731201443.GB24500@trent.me> <55BBE30A.8000304@comcast.net> Message-ID: <20150803001321.GC1474@trent.me> Hey Zach! On Fri, Jul 31, 2015 at 11:01:15PM -0500, Zachary Ware wrote: > On Fri, Jul 31, 2015 at 4:05 PM, Bob Hood wrote: > > Outstanding, Trent. Python's horrible multithreading support is > > something that has really kept it from being used in serious > > environments. Your work may not cover all platforms yet, but this > > is a great first step! > > I'd like to add a '[citation needed]' to your FUD here :). I think > Youtube and CERN both qualify as 'serious environments' from at least > two different perspectives. But that's a bit off-topic. > > Trent, is PyParallel still based on Python 3.3, and do you have any > plans to rebase onto a newer branch at some point? Yup, still technically based off 3.3.5. Once 3.5 has settled I'll rebase on that, probably in a few months. I've been avoiding it because of the memory allocation changes in 3.4 is going to make merging a bit of a pain. Trent. From trent at trent.me Mon Aug 3 02:08:45 2015 From: trent at trent.me (Trent Nelson) Date: Sun, 2 Aug 2015 20:08:45 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> References: <20150731201443.GB24500@trent.me> <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> Message-ID: <20150803000844.GA1474@trent.me> On Sat, Aug 01, 2015 at 02:54:16PM +0000, Paul_Koning at Dell.com wrote: > > > On Jul 31, 2015, at 4:14 PM, Trent Nelson > > wrote: > > > > Hi folks, > > > > Bit off-topic, but just wanted to let people know about an > > experimental proof-of-concept fork of Python 3 I've been working on > > for the past couple of years called PyParallel: > > http://pyparallel.org. It essentially gets around the GIL > > limitations and allows Python code to run simultaneously in multiple > > threads from within a single interpreter/process. > > > > It's Windows only -- so I figured it might be of interest to this > > list. > > Impressive. Is the Windows only aspect because you used Windows > proprietary thread APIs? Or because there is something special about > Windows thread mechanisms that doesn?t carry over to, say, POSIX > pthread? I assume the former, in other words it should be adaptable > to standard thread architectures with some effort. It's actually closer to the latter. I don't create a single thread with PyParallel -- I use the threadpool facilities exclusively. POSIX doesn't have anything like this -- the pthread abstraction is focused around the thread (the "worker"), not the work. (OS X has GCD, which comes close.) You *could* port PyParallel to POSIX, but you're either going to have to implement all the stuff Windows provides for free, which is a pretty big engineering effort. Even then, you're constrained by side-effects of the readiness-oriented I/O model (versus the completion-oriented model of Windows), so it becomes a lot harder to saturate all your I/O channels *and* peg all of your cores at 100% under load. (A typical multithreaded architecture will have a single thread dedicated to accept(), and then simply round-robin dispatch new FDs to a manual thread pool. A thread picks up the FD and adds it to its epoll/kqueue set -- that FD is now bound to that thread, which can quickly result in lop-sided resource allocation. The Windows I/O model revolves around the I/O request packet, which allows the "thread agnostic" separation between the I/O event (a write or read has completed) and the underlying thread used to handle the callback.) > paul Trent. From glyph at twistedmatrix.com Mon Aug 3 07:04:09 2015 From: glyph at twistedmatrix.com (Glyph) Date: Sun, 2 Aug 2015 22:04:09 -0700 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <20150803001019.GB1474@trent.me> References: <20150731201443.GB24500@trent.me> <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> <20150803001019.GB1474@trent.me> Message-ID: <271A392D-8A8F-4C63-ABC7-99746F9733A7@twistedmatrix.com> > On Aug 2, 2015, at 5:10 PM, Trent Nelson wrote: > > (OS X has GCD, which comes close.) For what it's worth, libdispatch has been ported to other POSIX platforms: https://lists.macosforge.org/pipermail/libdispatch-dev/2011-April/000485.html -glyph -------------- next part -------------- An HTML attachment was scrubbed... URL: From trent at snakebite.org Mon Aug 3 14:15:56 2015 From: trent at snakebite.org (Trent Nelson) Date: Mon, 3 Aug 2015 08:15:56 -0400 Subject: [python-win32] PyParallel - an experimental "multicore" fork of Python 3 for Windows In-Reply-To: <271A392D-8A8F-4C63-ABC7-99746F9733A7@twistedmatrix.com> References: <20150731201443.GB24500@trent.me> <4520C5B2-7640-4A4E-8065-D61FBF0F8E92@dell.com> <20150803001019.GB1474@trent.me> <271A392D-8A8F-4C63-ABC7-99746F9733A7@twistedmatrix.com> Message-ID: <20150803121554.GA494@trent.me> On Sun, Aug 02, 2015 at 10:04:09PM -0700, Glyph wrote: > > > On Aug 2, 2015, at 5:10 PM, Trent Nelson > > wrote: > > > > (OS X has GCD, which comes close.) > > For what it's worth, libdispatch has been ported to other POSIX > platforms: > https://lists.macosforge.org/pipermail/libdispatch-dev/2011-April/000485.html > Hmmm, it looks like pthread_workqueue has made it over too, which is a good sign. I know when FreeBSD first ported GCD it wasn't able to add in the "scheduler feedback" aspect that allowed the threadpool library to create new threads on demand: https://github.com/tpn/pdfs/blob/master/Grand%20Central%20Dispatch%20-%20FreeBSD%20Dev%20Summit%20(18%20Sep%202009).pdf (See the page starting with "pthread_workqueue"... although I just realized that PDF is nearly 6 years old!) The GCD approach is definitely the best option for getting PyParallel working on other platforms, so this is interesting. > -glyph Trent. From cappy2112 at gmail.com Mon Aug 3 22:20:23 2015 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 3 Aug 2015 13:20:23 -0700 Subject: [python-win32] argument passing problem on Windows 7 64-Bit Message-ID: Dennis, > C:\Users\Wulfraed\Documents\Python Progs>ftype Python.File > Python.File="C:\Python_x64\Python27\python.exe" "%1" %* This appears to have fixed my problem. I am now seeing output similar to yours, that is, the same output in both cases. I am curious how this issue came to be. I don't just edit the registry, because I don't know what to add/remove/change. Thank You! From kasra545 at gmail.com Tue Aug 4 12:04:04 2015 From: kasra545 at gmail.com (Kasra Keshavarz) Date: Tue, 4 Aug 2015 14:34:04 +0430 Subject: [python-win32] Using "WEAP" API in Python Message-ID: Hi, I'm facing problem in using WEAP API in python. I have installed WEAP correctly and have a 3.4.3 version python and also PythonWin (all of them are 32-bit). I'm not sure why this is happening. Here is the error message: >>> w = win32com.client.Dispatch("Weap.WeapApplication") Traceback (most recent call last): File "", line 1, in File "C:\Python34\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2147221005, 'Invalid class string', None, None) Thanks for cooperation :) Sincerely, Kasra Keshavarz -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Aug 4 18:41:47 2015 From: timr at probo.com (Tim Roberts) Date: Tue, 4 Aug 2015 09:41:47 -0700 Subject: [python-win32] Using "WEAP" API in Python In-Reply-To: References: Message-ID: <55C0EB4B.2030308@probo.com> Kasra Keshavarz wrote: > > I'm facing problem in using WEAP API in > python. I have installed WEAP correctly and have a 3.4.3 version > python and also PythonWin (all of them are 32-bit). I'm not sure why > this is happening. > > Here is the error message: > >>> w = win32com.client.Dispatch("Weap.WeapApplication") > Traceback (most recent call last): > File "", line 1, in > File "C:\Python34\lib\site-packages\win32com\client\__init__.py", > line 95, in Dispatch > dispatch, userName = > dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) > File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", > line 114, in _GetGoodDispatchAndUserName > return (_GetGoodDispatch(IDispatch, clsctx), userName) > File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", > line 91, in _GetGoodDispatch > IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, > pythoncom.IID_IDispatch) > pywintypes.com_error: (-2147221005, 'Invalid class string', None, None) Are you absolutely sure of the bittedness? Exactly this kind of thing can happen if WEAP is a 32-bit application but you installed the 64-bit Python, or vice versa. Are you sure that the app ID is "Weap.WeapApplication"? Do you know how to troll the registry to verify that? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Tue Aug 4 19:07:58 2015 From: timr at probo.com (Tim Roberts) Date: Tue, 4 Aug 2015 10:07:58 -0700 Subject: [python-win32] Using "WEAP" API in Python In-Reply-To: <55C0EB4B.2030308@probo.com> References: <55C0EB4B.2030308@probo.com> Message-ID: <55C0F16E.5030004@probo.com> Tim Roberts wrote: > Are you sure that the app ID is "Weap.WeapApplication"? Do you know how > to troll the registry to verify that? I see in the code samples that this is the correct App ID, so that's not the issue. You might try this from VBScript and see if it works. Create a file called test.vbs that contains: Set WEAP = CreateObject("WEAP.WEAPApplication") WEAP.Verbose = 4 WEAP.Logfile = "logfile.txt" then run it. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From kasra545 at gmail.com Tue Aug 4 19:35:09 2015 From: kasra545 at gmail.com (Kasra Keshavarz) Date: Tue, 4 Aug 2015 22:05:09 +0430 Subject: [python-win32] Using "WEAP" API in Python Message-ID: Firstly Thank you sir for helping. I have a 64-bit Windows 8.1 Installed. Already checked with python 3.4 and 2.7. Also tried with both 64-bit and 32-bit versions of python. WEAP itself didn't say much thing about its bit things. But I believe it's a 32-bit program. Also, I have tried this on a 32-bit Windows 7 OS as well, but no progress. Well I have no idea about using Windows Registry. In some sites, they suggest to check if there is a something in CLSID and ProgID (in windows registry) but I couldn't find them. As you said I created the file and again(!) I faced an error. I attach the error pic for you. The error message is this: Script: C:\Users\Kasra\Desktop\test.vbs Line: 1 Char: 1 Error: ActiveX component can't create object: "WEAP.WEAPApplication" Code: 800A01AD Source: Microsoft VBScript runtime error Sorry by mistake, I sent it twice. On Tue, Aug 4, 2015 at 9:37 PM, Tim Roberts wrote: > Tim Roberts wrote: > > Are you sure that the app ID is "Weap.WeapApplication"? Do you know how > > to troll the registry to verify that? > > I see in the code samples that this is the correct App ID, so that's not > the issue. You might try this from VBScript and see if it works. > Create a file called test.vbs that contains: > > Set WEAP = CreateObject("WEAP.WEAPApplication") > WEAP.Verbose = 4 > WEAP.Logfile = "logfile.txt" > > then run it. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Error.PNG Type: image/png Size: 9618 bytes Desc: not available URL: From timr at probo.com Tue Aug 4 19:59:30 2015 From: timr at probo.com (Tim Roberts) Date: Tue, 4 Aug 2015 10:59:30 -0700 Subject: [python-win32] Using "WEAP" API in Python In-Reply-To: References: Message-ID: <55C0FD82.3060204@probo.com> Kasra Keshavarz wrote: > Firstly Thank you sir for helping. > I have a 64-bit Windows 8.1 Installed. Already checked with python 3.4 > and 2.7. Also tried with both 64-bit and 32-bit versions of python. > WEAP itself didn't say much thing about its bit things. But I believe > it's a 32-bit program. Also, I have tried this on a 32-bit Windows 7 > OS as well, but no progress. > Well I have no idea about using Windows Registry. In some sites, they > suggest to check if there is a something in CLSID and ProgID (in > windows registry) but I couldn't find them. > As you said I created the file and again(!) I faced an error. I attach > the error pic for you. I think you're going to have to go to WEAP with this question. It certainly looks like the WEAP installer did not register its COM services. Does the WEAP GUI run OK? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From kasra545 at gmail.com Tue Aug 4 20:03:59 2015 From: kasra545 at gmail.com (Kasra Keshavarz) Date: Tue, 4 Aug 2015 22:33:59 +0430 Subject: [python-win32] Using "WEAP" API in Python In-Reply-To: <55C0FD82.3060204@probo.com> References: <55C0FD82.3060204@probo.com> Message-ID: Yes, fully installed and successfully licensed. I do not think there are enough experts in WEAP support. On Aug 4, 2015 10:29 PM, "Tim Roberts" wrote: > Kasra Keshavarz wrote: > > Firstly Thank you sir for helping. > > I have a 64-bit Windows 8.1 Installed. Already checked with python 3.4 > > and 2.7. Also tried with both 64-bit and 32-bit versions of python. > > WEAP itself didn't say much thing about its bit things. But I believe > > it's a 32-bit program. Also, I have tried this on a 32-bit Windows 7 > > OS as well, but no progress. > > Well I have no idea about using Windows Registry. In some sites, they > > suggest to check if there is a something in CLSID and ProgID (in > > windows registry) but I couldn't find them. > > As you said I created the file and again(!) I faced an error. I attach > > the error pic for you. > > I think you're going to have to go to WEAP with this question. It > certainly looks like the WEAP installer did not register its COM > services. Does the WEAP GUI run OK? > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kasra545 at gmail.com Tue Aug 4 20:56:48 2015 From: kasra545 at gmail.com (Kasra Keshavarz) Date: Tue, 4 Aug 2015 23:26:48 +0430 Subject: [python-win32] Using "WEAP" API in Python In-Reply-To: References: <55C0FD82.3060204@probo.com> Message-ID: Well, finally find the solution. You were right. Needed to be registered. With "WEAP /regserver" it will register itself. Then, API run successfully. Just sending this message for archiving, for those who might face this problem in future. On Aug 4, 2015 10:33 PM, "Kasra Keshavarz" wrote: > Yes, fully installed and successfully licensed. I do not think there are > enough experts in WEAP support. > On Aug 4, 2015 10:29 PM, "Tim Roberts" wrote: > >> Kasra Keshavarz wrote: >> > Firstly Thank you sir for helping. >> > I have a 64-bit Windows 8.1 Installed. Already checked with python 3.4 >> > and 2.7. Also tried with both 64-bit and 32-bit versions of python. >> > WEAP itself didn't say much thing about its bit things. But I believe >> > it's a 32-bit program. Also, I have tried this on a 32-bit Windows 7 >> > OS as well, but no progress. >> > Well I have no idea about using Windows Registry. In some sites, they >> > suggest to check if there is a something in CLSID and ProgID (in >> > windows registry) but I couldn't find them. >> > As you said I created the file and again(!) I faced an error. I attach >> > the error pic for you. >> >> I think you're going to have to go to WEAP with this question. It >> certainly looks like the WEAP installer did not register its COM >> services. Does the WEAP GUI run OK? >> >> -- >> Tim Roberts, timr at probo.com >> Providenza & Boekelheide, Inc. >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> https://mail.python.org/mailman/listinfo/python-win32 >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick at packetfrenzy.com Thu Aug 13 12:20:25 2015 From: nick at packetfrenzy.com (Nick Czeczulin) Date: Thu, 13 Aug 2015 10:20:25 +0000 Subject: [python-win32] PyIMAPIProp.GetPropList() and Py_None ref count Message-ID: I noticed that every call to PyIMAPIProp.GetPropList() causes the ref count for Py_None to increase by one. Can someone comment on whether the following patch seems correct, or if more might be needed? Thanks, -nick --- a/com/win32comext/mapi/src/mapilib.i +++ b/com/win32comext/mapi/src/mapilib.i @@ -501,6 +501,8 @@ } %typemap(python,argout) SPropTagArray **OUTPUT { + if ($target == Py_None) + Py_DECREF($target); $target = PyMAPIObject_FromSPropTagArray(*$source); if ($target==NULL) { $cleanup; -------------- next part -------------- An HTML attachment was scrubbed... URL: From aglozman at ELLINGTON.com Thu Aug 20 18:46:16 2015 From: aglozman at ELLINGTON.com (Andrey Glozman) Date: Thu, 20 Aug 2015 16:46:16 +0000 Subject: [python-win32] adodbapi 2.6.0.7 question Message-ID: <423BAF1B7019DF48AB0B4A444515DC00023CCC567D@ex0.ELLINGTON.com> Greetings, We are trying to use the adodbapi 2.6.0.7 and unable to change ADO CommandTimeout after connection is established. Would you be able to help us understand the best way to do it? Based on the adodbapi code - the only "timeout" parameter a user can provide is at the connection object instantiation. That timeout value is being used as a ConnectionTimeout (to connect to a server) and a CommandTimeout (to execute statement). Also, it is not clear how one can change CommandTimeout in between queries. Example case scenario: 1) Connect to a server (here we need ConnectionTimeout). Typically default 30 seconds is acceptable 2) Run Query1 - it might be some sort of a ping / database availability / user permissions / etc. (Here we need CommandTimeout). In many cases default 30 seconds is too much. 3) Run Query2 - it might be a job / report / process - (here we need different CommandTimeout than above). In some cases it takes minutes to run. Again, it seems that with existing implementation the above use case scenario is not possible. Thank you in advance, Andrey Glozman Ellington Management Group, LLC 53 Forest Avenue, Old Greenwich, CT 06870 P: 203.409.3574, M:203.912.7099 F: 203.698.0869 ============================================================================================= Email transmissions can not be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. In addition, the information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution,or copying of this communication, disclosure of the parties to it, or any action taken or omitted to be taken in reliance on it, is strictly prohibited, and may be unlawful. If you are not the intended recipient please delete this email message. ============================================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From aglozman at ELLINGTON.com Thu Aug 20 21:20:33 2015 From: aglozman at ELLINGTON.com (Andrey Glozman) Date: Thu, 20 Aug 2015 19:20:33 +0000 Subject: [python-win32] adodbapi 2.6.0.7 question In-Reply-To: <423BAF1B7019DF48AB0B4A444515DC00023CCC567D@ex0.ELLINGTON.com> References: <423BAF1B7019DF48AB0B4A444515DC00023CCC567D@ex0.ELLINGTON.com> Message-ID: <423BAF1B7019DF48AB0B4A444515DC00023CCC64C6@ex0.ELLINGTON.com> Please disregard. We found a way to change timeout on the "connection" object. Thank you, Andrey Glozman Ellington Management Group, LLC 53 Forest Avenue, Old Greenwich, CT 06870 P: 203.409.3574, M:203.912.7099 F: 203.698.0869 From: Andrey Glozman Sent: Thursday, August 20, 2015 12:46 PM To: 'python-win32 at python.org' Subject: adodbapi 2.6.0.7 question Greetings, We are trying to use the adodbapi 2.6.0.7 and unable to change ADO CommandTimeout after connection is established. Would you be able to help us understand the best way to do it? Based on the adodbapi code - the only "timeout" parameter a user can provide is at the connection object instantiation. That timeout value is being used as a ConnectionTimeout (to connect to a server) and a CommandTimeout (to execute statement). Also, it is not clear how one can change CommandTimeout in between queries. Example case scenario: 1) Connect to a server (here we need ConnectionTimeout). Typically default 30 seconds is acceptable 2) Run Query1 - it might be some sort of a ping / database availability / user permissions / etc. (Here we need CommandTimeout). In many cases default 30 seconds is too much. 3) Run Query2 - it might be a job / report / process - (here we need different CommandTimeout than above). In some cases it takes minutes to run. Again, it seems that with existing implementation the above use case scenario is not possible. Thank you in advance, Andrey Glozman Ellington Management Group, LLC 53 Forest Avenue, Old Greenwich, CT 06870 P: 203.409.3574, M:203.912.7099 F: 203.698.0869 ============================================================================================= Email transmissions can not be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. In addition, the information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution,or copying of this communication, disclosure of the parties to it, or any action taken or omitted to be taken in reliance on it, is strictly prohibited, and may be unlawful. If you are not the intended recipient please delete this email message. ============================================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Fri Aug 21 06:44:46 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 20 Aug 2015 22:44:46 -0600 Subject: [python-win32] adodbapi 2.6.0.7 question In-Reply-To: <423BAF1B7019DF48AB0B4A444515DC00023CCC64C6@ex0.ELLINGTON.com> References: <423BAF1B7019DF48AB0B4A444515DC00023CCC567D@ex0.ELLINGTON.com> <423BAF1B7019DF48AB0B4A444515DC00023CCC64C6@ex0.ELLINGTON.com> Message-ID: Andrey: Good catch. I have added the following to the quickref documentation for the "connection" class: .timeout # supply a value for CommandTimeout. Note: the "timeout" > connection value is stored in this attribute, and is used as the connection > timeout. It is then re-used as the command timeout. The user may overcome > this rather goofy "feature" by supplying a different value to this > attribute after the connection is made. The value is in seconds, and will > be used for all subsequent SQL commands. > On Thu, Aug 20, 2015 at 1:20 PM, Andrey Glozman wrote: > Please disregard. > > We found a way to change timeout on the ?connection? object. > > > > Thank you, > > Andrey Glozman > > Ellington Management Group, LLC > > 53 Forest Avenue, Old Greenwich, CT 06870 > > *P*: 203.409.3574, *M*:203.912.7099 *F*: 203.698.0869 > > > > *From:* Andrey Glozman > *Sent:* Thursday, August 20, 2015 12:46 PM > *To:* 'python-win32 at python.org' > *Subject:* adodbapi 2.6.0.7 question > > > > Greetings, > > We are trying to use the adodbapi 2.6.0.7 and unable to change ADO > CommandTimeout after connection is established. Would you be able to help > us understand the best way to do it? > > > > Based on the adodbapi code ? the only ?timeout? parameter a user can > provide is at the connection object instantiation. That timeout value is > being used as a ConnectionTimeout (to connect to a server) and a > CommandTimeout (to execute statement). > > Also, it is not clear how one can change CommandTimeout in between > queries. > > > > Example case scenario: > > 1) Connect to a server (here we need ConnectionTimeout). Typically > default 30 seconds is acceptable > > 2) Run Query1 - it might be some sort of a ping / database > availability / user permissions / etc. (Here we need CommandTimeout). In > many cases default 30 seconds is too much. > > 3) Run Query2 ? it might be a job / report / process - (here we need > different CommandTimeout than above). In some cases it takes minutes to run. > > > > Again, it seems that with existing implementation the above use case > scenario is not possible. > > > > Thank you in advance, > > Andrey Glozman > > Ellington Management Group, LLC > > 53 Forest Avenue, Old Greenwich, CT 06870 > > *P*: 203.409.3574, *M*:203.912.7099 *F*: 203.698.0869 > > > > > ============================================================================================= > Email transmissions can not be guaranteed to be secure or error-free, as > information could be intercepted, corrupted, lost, destroyed, arrive late > or incomplete, or contain viruses. The sender therefore does not accept > liability for any errors or omissions in the contents of this message which > arise as a result of email transmission. In addition, the information > contained in this email message is intended only for use of the individual > or entity named above. If the reader of this message is not the intended > recipient, or the employee or agent responsible to deliver it to the > intended recipient, you are hereby notified that any dissemination, > distribution,or copying of this communication, disclosure of the parties to > it, or any action taken or omitted to be taken in reliance on it, is > strictly prohibited, and may be unlawful. If you are not the intended > recipient please delete this email message. > ============================================================================================== > ?? > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Mon Aug 24 11:10:51 2015 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 24 Aug 2015 19:10:51 +1000 Subject: [python-win32] PyIMAPIProp.GetPropList() and Py_None ref count In-Reply-To: References: Message-ID: <55DADF9B.2070606@gmail.com> On 13/08/2015 8:20 PM, Nick Czeczulin wrote: > I noticed that every call to PyIMAPIProp.GetPropList() causes the ref > count for Py_None to increase by one. Can someone comment on whether the > following patch seems correct, or if more might be needed? At face value it looks wrong, but I'm not sure without more digging what the correct fix is, or why all other SWIG-based types don't have the same issue. I'm getting to most of your other issues on SourceForge and I suspect I wont find time to dig deeper on this before I make another release as the consequences of this seem fairly small (I'm sure None has many reference leaks :) Cheers, Mark > > Thanks, > -nick > > --- a/com/win32comext/mapi/src/mapilib.i > +++ b/com/win32comext/mapi/src/mapilib.i > @@ -501,6 +501,8 @@ > } > > %typemap(python,argout) SPropTagArray **OUTPUT { > + if ($target == Py_None) > + Py_DECREF($target); > $target = PyMAPIObject_FromSPropTagArray(*$source); > if ($target==NULL) { > $cleanup; > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > From nick at packetfrenzy.com Tue Aug 25 16:35:46 2015 From: nick at packetfrenzy.com (Nick Czeczulin) Date: Tue, 25 Aug 2015 07:35:46 -0700 Subject: [python-win32] PyIMAPIProp.GetPropList() and Py_None ref count In-Reply-To: <55DADF9B.2070606@gmail.com> References: <55DADF9B.2070606@gmail.com> Message-ID: <55DC7D42.6090000@packetfrenzy.com> On 8/24/2015 2:10 AM, Mark Hammond wrote: > On 13/08/2015 8:20 PM, Nick Czeczulin wrote: >> I noticed that every call to PyIMAPIProp.GetPropList() causes the ref >> count for Py_None to increase by one. Can someone comment on whether the >> following patch seems correct, or if more might be needed? > > At face value it looks wrong, but I'm not sure without more digging what > the correct fix is, or why all other SWIG-based types don't have the > same issue. I'm getting to most of your other issues on SourceForge and > I suspect I wont find time to dig deeper on this before I make another > release as the consequences of this seem fairly small (I'm sure None has > many reference leaks :) I've since submitted a patch after identifying the following in pythoncom.i without clarifying in the patch description (only noting the methods impacted): %typemap(python,out) HRESULT { $target = Py_None; Py_INCREF(Py_None); } It can be verified in the generated .cpp file (See: GetPropsList): { _resultobj = Py_None; Py_INCREF(Py_None); } { _resultobj = PyMAPIObject_FromSPropTagArray(*_arg1); Also, browsing mapilib.i's typemaps, only some test $target and call Py_DECREF(), so the HRESULT typemap might be affecting some of the other mapi calls as well for other output types. But, I definitely understand your point on it being better to leak a Py_None ref than the alternative due to a misunderstanding on my part. Regarding my other outstanding patches, please ignore #138 for now -- I'd like to update it to be consistent with the updates you made for the PT_MV_BINARY (#137) patch. Thanks, -nick > > Cheers, > > Mark >> >> Thanks, >> -nick >> >> --- a/com/win32comext/mapi/src/mapilib.i >> +++ b/com/win32comext/mapi/src/mapilib.i >> @@ -501,6 +501,8 @@ >> } >> >> %typemap(python,argout) SPropTagArray **OUTPUT { >> + if ($target == Py_None) >> + Py_DECREF($target); >> $target = PyMAPIObject_FromSPropTagArray(*$source); >> if ($target==NULL) { >> $cleanup; >> >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> https://mail.python.org/mailman/listinfo/python-win32 >> > From christopher.f.nyland.ctr at mail.mil Wed Aug 26 19:28:47 2015 From: christopher.f.nyland.ctr at mail.mil (Nyland, Christopher F CTR USARMY AMSAA (US)) Date: Wed, 26 Aug 2015 17:28:47 +0000 Subject: [python-win32] PythonService.exe Network Service Message-ID: Hello, So I am trying to implement a small internal web server using Flask and Tornado. I would like it to run as a service. I am running into a problem though some of my underlying code needs to use UNC paths to grab files off other computers on the network. However at lease on our machine it seems the only way to do this is to run as a network service or at least that is what I want to try. So I made a stripped down version of the service and it will run fine a a local system service. If I change it to run as a Network Service it keeps failing. I keep getting error messages from the windows log like below Python could not import the services's module ImportError: No module named service %2: %3 I have tried a couple of different things the module that is not found always seems to be the name of the file that is linked to the service in this case service.py. I have seen that there is am implementation that bypasses the PythonService.exe but there were some warnings attached to that. I just am trying to figure out if anyone has had this problem before and if I am going down the right path. My environment is Windows Server 2008 R2 Thanks, Chris Nyland From timr at probo.com Wed Aug 26 21:18:52 2015 From: timr at probo.com (Tim Roberts) Date: Wed, 26 Aug 2015 12:18:52 -0700 Subject: [python-win32] PythonService.exe Network Service In-Reply-To: References: Message-ID: <55DE111C.5090508@probo.com> Nyland, Christopher F CTR USARMY AMSAA (US) wrote: > Python could not import the services's module > ImportError: No module named service > %2: %3 > > I have tried a couple of different things the module that is not found always seems to be the name of the file that is linked to the service in this case service.py. Services and Network Services each have their own user name, and every user has its own permissions. It's possible, for example, that your service.py or the directory it is in is simply not accessible by the Network Service user name. If you have the file in your \Users\username\Documents path, that's almost certainly the issue. Check the file in Explorer to see if it is readable by Everyone. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc.