[python-win32] install_requires 'pywin32' problem?
Hey there, I hope someone can help me ;-) I have added "pywin32" as a dependency for a small library I created, but when it tries to download the "PYWIN32" dependency it dies Processing dependencies for LogosQueue==1.0.0 Searching for pywin32 Reading http://pypi.python.org/simple/pywin32/ Reading http://sf.net/projects/pywin32 Reading http://sourceforge.net/project/showfiles.php?group_id=78018 No local packages or download links found for pywin32 error: Could not find suitable distribution for Requirement.parse('pywin32') I have the latest version of "setuptools" installed, just scratching my head as to what could be wrong here? Any ideas? Lynton ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] MSMQ - cannot catch COM_ERROR with"pythoncom.com_error"
Hi there, Please help me ;-) I know how to push / pop messages off of a MSMQ, also how to create a queue etc.but my problem is I cannot seen to catch the "com_error" when I try create a MSMQ that already exists ;-( The basic code is as follows: import win32com.client import pythoncom import os try: queue_info = win32com.client.Dispatch("MSMQ.MSMQQueueInfo") computer_name = os.getenv('COMPUTERNAME') format_name = "direct=os:" + computer_name + "\\private$\\test3" queue_info.FormatName=format_name queue=queue_info.Open(2,0) "Dies here obviously as queue does not exist except pythoncom.com_error: #Queue does not exist...create queue queue_info.PathName = ".\\private$\\test3" queue_info.Label = "New Queue" queue_info.Create() I get an Exception raised in WingIDE that says something like "com_error..the queue does not exist or you do not have sufficient permissions etc" - something like that. This is the line in "IMSMQQueueInfo3.py" that it is dying on. def Open(self, Access=defaultNamedNotOptArg, ShareMode=defaultNamedNotOptArg): """Method used to open a queue. The PathName property must be specified to open a queue. Parameters include Access (send, peek, or receive) and ShareMode (exclusive or all).""" ret = self._oleobj_.InvokeTypes(1610743835, LCID, 1, (9, 0), ((3, 1), (3, 1)),Access , ShareMode) Here is the wingide error http://www.nabble.com/file/p18586458/error.png File "D:\Documents and Settings\Lynton\Desktop\test_reg.py", line 10, in ? queue=queue_info.Open(2,0) File "D:\Python24\Lib\site-packages\win32com\gen_py\D7D6E071-DCCD-11D0-AA4B-00609 70DEBAEx0x3x0\IMSMQQueueInfo3.py", line 46, in Open , ShareMode) Any ideas on how I can catch ANY COM type error here? Why would it ignore the pythoncom.com_error??? Your help would be greatly appreciated ;-) Lynton -- View this message in context: http://www.nabble.com/MSMQ---cannot-catch-COM_ERROR-with-%22pythoncom.com_er ror%22-tp18586458p18586458.html Sent from the Python - python-win32 mailing list archive at Nabble.com. ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] FW: MSMQ - cannot catchCOM_ERROR with"pythoncom.com_error"
Hey Tim, Wow, you are 100% correctthere was something in WingIDE that is not happystrange I ran the same code in the standard interpreter and it caught the error perfectly BTW: What IDE's do you guys use for Python? Thanks a million, have a great day! Lynton -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden Sent: 22 July 2008 05:21 PM Cc: python-win32@python.org Subject: Re: [python-win32] MSMQ - cannot catchCOM_ERROR with"pythoncom.com_error" Lynton Grice wrote: > Please help me ;-) I know how to push / pop messages off of a MSMQ, also how > to create a queue etc.but my problem is I cannot seen to catch the > "com_error" when I try create a MSMQ that already exists ;-( The basic code > is as follows: > > import win32com.client > import pythoncom > import os > > try: > queue_info = win32com.client.Dispatch("MSMQ.MSMQQueueInfo") > computer_name = os.getenv('COMPUTERNAME') > format_name = "direct=os:" + computer_name + "\\private$\\test3" > > queue_info.FormatName=format_name > queue=queue_info.Open(2,0) "Dies here obviously as queue does not exist > except pythoncom.com_error: > #Queue does not exist...create queue > queue_info.PathName = ".\\private$\\test3" > queue_info.Label = "New Queue" > queue_info.Create() > > I get an Exception raised in WingIDE that says something like > "com_error..the queue does not exist or you do not have sufficient > permissions etc" - something like that. I can't see anything obvious (aside from the possible dangers inherent in assuming that *any* com_error means the queue doesnt' exist). I assume that the -- "Dies here... -- isn't in the original code? Does the same thing happen if you run in the standard interpreter? (Don't know if WingIDE does anything fancy to intercept exceptions). If the same does happen in the interpreter, can you use the traceback module / sys.exc_info to determine exactly what exception is raised and how it relates to pythoncom.com_error? TJG ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32