[Pythonmac-SIG] findertools.launch reports "no eligible process"
hi there, i was wondering if anyone else has seen this behavior with the findertools.launch() function. the docs indicate that when given a pathname, launch(path) will launch a Finder window with that path. but when i try to launch any valid path i get this error: >>> os.path.exists("/Users/drew/Documents") True >>> findertools.launch("/Users/drew/Documents") Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/findertools.py", line 45, in launch return finder.open(fss) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py", line 248, in open _arguments, _attributes) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/aetools.py", line 226, in send return self.sendevent(self.newevent(code, subcode, parameters, attributes)) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/aetools.py", line 220, in sendevent self.send_timeout) MacOS.Error: (-600, 'no eligible process with specified descriptor') >>> i get the same error across reboots, on real hardware (x86) or a VM; from a Terminal window or IDLE; with directories or files or applications, etc. -- all this -600 error; (if i specify an invalid path i do get a file not found error.) i mostly come from windows land (and basically looking for a stand-in for ShellExecute), so if i'm doing something horribly wrong please let me know :) i'm using OS X 10.4.9 and MacPython 2.4.4 and can't think of anything unusual that might be causing it. (killing the finder and restarting it also does not help; the process is certainly running.) thanks! drew ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
On Friday, June 08, 2007, at 09:55AM, "Drew Houston" <[EMAIL PROTECTED]> wrote: >hi there, > >i was wondering if anyone else has seen this behavior with the >findertools.launch() function. the docs indicate that when given a >pathname, launch(path) will launch a Finder window with that path. but >when i try to launch any valid path i get this error: Please file a bug at http://sourceforge.net/projects/python, this seems to be yet another byteorder bug in the OSA support in the core python distribution. Findertools seem to work correcty on PPC, but fails on Intel systems. The session below forces a run of the PPC version of python on my macbook: [EMAIL PROTECTED] /usr/libexec/oah/translate /Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.byteorder 'big' >>> import findertools >>> findertools.launch("/tmp") >>> This does indeed open the /tmp folder in the finder. BTW. appscript (http://appscript.sourceforge.net/) is in general a much more useful OSA/AppleScript interface for use in python. > > >>> os.path.exists("/Users/drew/Documents") >True > >>> findertools.launch("/Users/drew/Documents") >Traceback (most recent call last): > File "", line 1, in ? > File >"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/findertools.py", > >line 45, in launch >return finder.open(fss) > File >"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/lib-scriptpackages/Finder/Standard_Suite.py", > >line 248, in open >_arguments, _attributes) > File >"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/aetools.py", > >line 226, in send >return self.sendevent(self.newevent(code, subcode, parameters, >attributes)) > File >"/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/plat-mac/aetools.py", > >line 220, in sendevent >self.send_timeout) >MacOS.Error: (-600, 'no eligible process with specified descriptor') > >>> > >i get the same error across reboots, on real hardware (x86) or a VM; >from a Terminal window or IDLE; with directories or files or >applications, etc. -- all this -600 error; (if i specify an invalid path >i do get a file not found error.) i mostly come from windows land (and >basically looking for a stand-in for ShellExecute), so if i'm doing >something horribly wrong please let me know :) > >i'm using OS X 10.4.9 and MacPython 2.4.4 and can't think of anything >unusual that might be causing it. (killing the finder and restarting it >also does not help; the process is certainly running.) > >thanks! > >drew > >___ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
Ronald Oussoren wrote: >> i was wondering if anyone else has seen this behavior with the >> findertools.launch() function. the docs indicate that when given a >> pathname, launch(path) will launch a Finder window with that path. >> but >> when i try to launch any valid path i get this error: > > Please file a bug at http://sourceforge.net/projects/python, this > seems to be yet another byteorder bug in the OSA support in the > core python distribution. You might add a note that since findertools uses aetools which is [over]due for deprecation, findertools should be deprecated as well. Anyway, simplest solution here is: import subprocess subprocess.call(['open', '/Users/drew/Documents']) Or you can do it with appscript if you prefer: from appscript import * from mactypes import Alias path = '/Users/drew/Documents' app('Finder').items[Alias(path)].open() has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
On Friday, June 08, 2007, at 02:57PM, "Kent Johnson" <[EMAIL PROTECTED]> wrote: >has wrote: >> Anyway, simplest solution here is: >> >> import subprocess >> subprocess.call(['open', '/Users/drew/Documents']) > >or >import open import os # ;-) >os.system('open /Users/drew/Documents') That works but is non-trivial to get entirely correct due to quoting. Using subprocess is much better because you don't have to worry about quoting for the shell. Os.popen and os.system should basically be deprecated, but that will probably not happen anytime soon because they are used a lot in existing code. Ronald > >Kent >___ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
has wrote: > Anyway, simplest solution here is: > > import subprocess > subprocess.call(['open', '/Users/drew/Documents']) or import open os.system('open /Users/drew/Documents') Kent ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
Ronald Oussoren wrote: Using subprocess is much better because you don't have to worry about quoting for the shell. Os.popen and os.system should basically be deprecated, but that will probably not happen anytime soon because they are used a lot in existing code. > I use os.popen because it supports non-blocking output: subprocess does not, at least not without some additional hacks. I'm glad it will still be around for a while. -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] findertools.launch reports "no eligible process"
On 8-Jun-2007, at 13:19 , has wrote: You might add a note that since findertools uses aetools which is [over]due for deprecation, findertools should be deprecated as well. [...] Or you can do it with appscript if you prefer: from appscript import * from mactypes import Alias path = '/Users/drew/Documents' app('Finder').items[Alias(path)].open() Problem with deprecating aetools is that there is a truckload of modules that depend on it, findertools among them. I'd love to rewrite them to use appscript, and it wouldn't even be all that much work, but I simply don't have the time (and probably won't have the time in the coming few years). -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig