From gary at zope.com Fri Dec 1 02:49:51 2006 From: gary at zope.com (Gary Poster) Date: Thu, 30 Nov 2006 20:49:51 -0500 Subject: [Pythonmac-SIG] Does anyone on the planet know how to build python-2.5 (WITH READLINE)? In-Reply-To: <455B6B5B.5020208@lanl.gov> References: 20060627143827.45945.qmail@web52303.mail.yahoo.com <455B6B5B.5020208@lanl.gov> Message-ID: On Nov 15, 2006, at 2:32 PM, Todd Thal wrote: > I am having one "hades" of a heckuva time getting readline support for > Python-2.5 on a Mac OS 10.4.8.8.0 Thanks to Ronald and Skip for replying to this thread. It took me a little bit to connect the dots from their replies, so I thought I'd share my experiences. Maybe this can help someone, and maybe also lead to Ronald or someone else clarifying the right way to use his CFLAGS and LDFLAGS patch. I'm using darwinports, so first I had to sudo port install readline Once that was done, I wanted to build a local, non-framework Python with readline. darwinports uses /opt/local, so Ronald's approach led me to this best guess: $ CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure -- prefix=/Users/gary/py $ make However, that was unsuccessful. $ ./python.exe Python 2.4.4 (#1, Nov 30 2006, 20:36:29) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import readline Traceback (most recent call last): File "", line 1, in ? ImportError: No module named readline Maybe someone could let me know what I did wrong? Skip's approach was a little more unusual, at least to me, since it was a step in-between `make` and `make install`. However, it worked. :-) If, after a configure and a make (but, again, before a make install) I run this command... $ ./python.exe setup.py build_ext --include-dirs=/opt/local/include -- library-dirs=/opt/local/lib ...then readline appears in glory. $ ./python.exe Python 2.4.4 (#1, Nov 30 2006, 20:36:29) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import readline >>> Yay! Of course, I could have copied readline.so from MacPython but that would have been cheating. :-) HTH someone Gary From ronaldoussoren at mac.com Fri Dec 1 17:04:03 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 1 Dec 2006 17:04:03 +0100 Subject: [Pythonmac-SIG] Does anyone on the planet know how to build python-2.5 (WITH READLINE)? In-Reply-To: References: "20060627143827.45945.qmail@web52303.mail.yahoo.com" <455B6B5B.5020208@lanl.gov> Message-ID: On 1 Dec 2006, at 2:49 AM, Gary Poster wrote: > > On Nov 15, 2006, at 2:32 PM, Todd Thal wrote: > >> I am having one "hades" of a heckuva time getting readline support >> for >> Python-2.5 on a Mac OS 10.4.8.8.0 > > Thanks to Ronald and Skip for replying to this thread. It took me a > little bit to connect the dots from their replies, so I thought I'd > share my experiences. Maybe this can help someone, and maybe also > lead to Ronald or someone else clarifying the right way to use his > CFLAGS and LDFLAGS patch. > > I'm using darwinports, so first I had to > > sudo port install readline > > Once that was done, I wanted to build a local, non-framework Python > with readline. darwinports uses /opt/local, so Ronald's approach led > me to this best guess: > > $ CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure -- > prefix=/Users/gary/py This should do the trick, more or less. The build script for the python.org installer uses: ./configure --prefix=/Users/gary/py LDFLAGS=-L/opt/local/lib OPT=-I/ opt/local/include > $ make If you're using macports you might as well do 'port install python2.4'. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061201/fd6fbff3/attachment.bin From Chris.Barker at noaa.gov Fri Dec 1 18:18:29 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 01 Dec 2006 09:18:29 -0800 Subject: [Pythonmac-SIG] [Fwd: [wxPython-users] wxPython 2.8 RC - Call for testers! :-)] Message-ID: <457063E5.1040801@noaa.gov> HI all, This went out over the wxPython list, but I thought I'd post it here as generally, the Mac gets the least testing. Also, given that it looks like Apple is going to put 2.8 in their next release, and they don't have a history of updating things like that, it's all the more important to get as much testing as possible on the Mac. -Chris -------- Original Message -------- Subject: [wxPython-users] wxPython 2.8 RC - Call for testers! :-) Date: Thu, 30 Nov 2006 16:38:59 -0800 From: Kevin Ollivier Reply-To: wxPython-users at lists.wxwidgets.org To: wxPython-users at lists.wxwidgets.org Hi all, Robin made an announcement about the upcoming release of wxWidgets 2.8 next week on wxpython-dev, but I thought that 2.8 Release Candidate (RC) testing merited an extra call for help on wxPython- users as well. So, if you're good at making programs crash, implode, or otherwise freak out, we need your help! :-) We're on the last stretch for 2.8, and particularly as it is going to be included in the default install of OS X 10.5, Leopard, we'd like it to be as solid and slick as possible. So if you have apps, frameworks, scripts, or one-liners written using wx, we would appreciate any time you could spend testing them with the 2.8 RC. Even if it's just 15 minutes, or with one script, or testing the demo... every little bit helps. We probably won't get to everything reported before the release, but it's better to find all the issues we can, so we can at least prioritize and fix the really nasty ones. Oh, and if you don't mind fixing bugs too, well, I promise we won't complain! :-) The wxPython 2.8 RC can be found here: http://wxpython.wxcommunity.com/preview/20061129/ Thanks! Kevin --------------------------------------------------------------------- To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From cdamundsen at gmail.com Sat Dec 2 04:45:38 2006 From: cdamundsen at gmail.com (Craig Amundsen) Date: Fri, 1 Dec 2006 19:45:38 -0800 Subject: [Pythonmac-SIG] controlling iTunes with appscript In-Reply-To: <20061128193021.GA48180@uiuc.edu> References: <456C66F8.4080306@eurotalk.com> <8c7f10c60611280918l786afbecvbfc73b9734381935@mail.gmail.com> <456C757C.6040603@eurotalk.com> <8dc0c28f0611281109k366efe79lcff010f0ee173f5@mail.gmail.com> <20061128193021.GA48180@uiuc.edu> Message-ID: <8dc0c28f0612011945n988e007x1cf0e7bc4a9b6d3e@mail.gmail.com> Hi - I finally had time to play around with appscript, and can now get the list of tracks. For reasons I don't understand, if I try to get all the file_tracks in the library, iTunes shoots up to about 80% CPU utilization and never comes back, even if I set the timeout to 15 minutes. But if I put all the songs in a playlist and get the songs with app('iTunes').sources[1].user_playlists['PlaylistOfAllSongs'].file_tracks.get() it takes a while, but eventually comes back with list of tracks. > Just FYI if you don't know already, iTunes uses aliases to keep track > of file locations, so if you're not moving across volumes, you > shouldn't have to do anything at all. > You may end up needing to use HFS rather than POSIX paths, or even > aliases, depending on what iTunes expects. If I get the location of a track eg, >>> t.location.get() macfile.Alias(u'/Volumes/FirewireHD/iTunes/Air/Talkie Walkie/02 Cherry Blossom Girl.mp3') the location is definitely a macfile.Alias I am moving my songs between Volumes, so I do have to do something. If I try: >>> f = macfile.Alias(u'/Volumes/RAID/iTunes/Air/Talkie Walkie/02 Cherry Blossom Girl.mp3') >>> t.location.set(f) I get this error: Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/aeosa/appscript/reference.py", line 281, in __call__ raise CommandError(self, (args, kargs), e) appscript.reference.CommandError: 'NoneType' object has no attribute '__name__' Failed command: app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(388392).file_tracks.ID(388445).location.set(macfile.Alias(u'/Volumes/RAID500/iTunes/Air/Talkie Walkie/02 Cherry Blossom Girl.mp3')) Any hints would be greatly appreciated. Thanks, - Craig From bthom at cs.hmc.edu Mon Dec 4 08:14:49 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Sun, 03 Dec 2006 23:14:49 -0800 Subject: [Pythonmac-SIG] seeking matplotlib install advice Message-ID: <400392E2-CA02-44A0-AEF5-AA5AC8DD7109@cs.hmc.edu> Hi, I've installed matplotlib (v 0.87.6_0) via macports (os x 10.4.8, python 2.4.3). I've tried following the "interactive" instructions at matplotlib.sourceforge.net/interactive.html, which tells me to modify matplotlibrc as follows: interactive : True backend : TkAgg My general usage is via ipython -pylab, which should automatically setup the necessary extra thread for plotting, but I've seen similar behavior in vanilla python shells as well. I can run matplotlib commands (e.g. plot([1,2,3])) but plot windows are never shown (even after I explicitly call show()). I can save the figure and view it as a pgn, so much is working. When I configure matplotlibrc via the rec'd TkAgg backend, I get the following error: Traceback (most recent call last): File "/opt/local/bin/ipython", line 28, in ? IPython.Shell.start().mainloop() [snip] File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/ backend_tkagg.py", line 8, in ? import tkagg # Paint image to Tk photo blitter extension File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/ tkagg.py", line 1, in ? import _tkagg ImportError: No module named _tkagg A google search led me to believe I didn't have "the proper tcl-dev/ tk-dev" directories. I then noticed there was a +gt2k macports matplotlib variant, and found another search snippet that led me to believe installing this new variant might relieve my woes. No such luck. Has anyone gotten matplotlib to plot figures interactively in the macports/python24 setting? Advice greatly appreciated. --b From njriley at uiuc.edu Mon Dec 4 08:37:57 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Mon, 4 Dec 2006 01:37:57 -0600 Subject: [Pythonmac-SIG] controlling iTunes with appscript In-Reply-To: <8dc0c28f0612011945n988e007x1cf0e7bc4a9b6d3e@mail.gmail.com> References: <456C66F8.4080306@eurotalk.com> <8c7f10c60611280918l786afbecvbfc73b9734381935@mail.gmail.com> <456C757C.6040603@eurotalk.com> <8dc0c28f0611281109k366efe79lcff010f0ee173f5@mail.gmail.com> <20061128193021.GA48180@uiuc.edu> <8dc0c28f0612011945n988e007x1cf0e7bc4a9b6d3e@mail.gmail.com> Message-ID: <20061204073757.GA14509@uiuc.edu> On Fri, Dec 01, 2006 at 07:45:38PM -0800, Craig Amundsen wrote: > >>> t.location.set(f) Yeah, you can't do this. If you look in the dictionary (for example, opening it in Script Editor), you'll see: location (alias, r/o) : the location of the file represented by this track The location property is read only. The only way I can think to move files across disks in iTunes and have the references stay intact is to use the "Consolidate Library" command. To do that, reset the iTunes Music Library location (Preferences > Advanced > General) to where you want the files to go, then choose "Consolidate Library" from the Advanced menu, and all your music will move there. Sorry for giving you advice before checking what you wanted to do was possible. That's the second time today I've made that mistake recently (the other one cost me about 2 hours of trying to compile Kerberos on AIX today.) In the strange coincidences category, "Cherry Blossom Girl" just came on the streaming station I'm listening to. Scary. -- Nicholas Riley | From cdamundsen at gmail.com Mon Dec 4 17:00:53 2006 From: cdamundsen at gmail.com (Craig Amundsen) Date: Mon, 4 Dec 2006 08:00:53 -0800 Subject: [Pythonmac-SIG] controlling iTunes with appscript In-Reply-To: <20061204073757.GA14509@uiuc.edu> References: <456C66F8.4080306@eurotalk.com> <8c7f10c60611280918l786afbecvbfc73b9734381935@mail.gmail.com> <456C757C.6040603@eurotalk.com> <8dc0c28f0611281109k366efe79lcff010f0ee173f5@mail.gmail.com> <20061128193021.GA48180@uiuc.edu> <8dc0c28f0612011945n988e007x1cf0e7bc4a9b6d3e@mail.gmail.com> <20061204073757.GA14509@uiuc.edu> Message-ID: <8dc0c28f0612040800s331ec0e7tcee42b792e3c668f@mail.gmail.com> Hi - On Fri, Dec 01, 2006 at 07:45:38PM -0800, Craig Amundsen wrote: > > >>> t.location.set(f) > > Yeah, you can't do this. If you look in the dictionary (for example, > opening it in Script Editor), you'll see: > > location (alias, r/o) : the location of the file represented by this track > > The location property is read only. I was afraid of that. Thanks for letting me know. The only way I can think to move files across disks in iTunes and have > the references stay intact is to use the "Consolidate Library" > command. To do that, reset the iTunes Music Library location > (Preferences > Advanced > General) to where you want the files to go, > then choose "Consolidate Library" from the Advanced menu, and all your > music will move there. I've tried that. I'm trying to move my library from one external Firewire drive to an external RAID1 setup. Doing the consolidate moved about 10% of the files and then crapped out with an error that said something about being able to read/write a drive. Repeated attempts to consolidate the library now die with the read/write error immediately. I don't think it's a problem with either drive since I can read and write from both of them. It may be that RAID is too slow to keep up with whatever iTunes is trying to do. I was hoping I could do a manual copy and then update all the locations via appscript. This having the advantage of allowing me to preserve metadata. I guess it's time to forget about the metadata since I'm not going to do the one-at-a-time location update from within iTunes. - Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061204/7f8f7f99/attachment.htm From delza at livingcode.org Mon Dec 4 19:23:17 2006 From: delza at livingcode.org (Dethe Elza) Date: Mon, 4 Dec 2006 10:23:17 -0800 Subject: [Pythonmac-SIG] controlling iTunes with appscript In-Reply-To: <8dc0c28f0612040800s331ec0e7tcee42b792e3c668f@mail.gmail.com> References: <456C66F8.4080306@eurotalk.com> <8c7f10c60611280918l786afbecvbfc73b9734381935@mail.gmail.com> <456C757C.6040603@eurotalk.com> <8dc0c28f0611281109k366efe79lcff010f0ee173f5@mail.gmail.com> <20061128193021.GA48180@uiuc.edu> <8dc0c28f0612011945n988e007x1cf0e7bc4a9b6d3e@mail.gmail.com> <20061204073757.GA14509@uiuc.edu> <8dc0c28f0612040800s331ec0e7tcee42b792e3c668f@mail.gmail.com> Message-ID: <6B54E4DF-3D89-4402-973A-FC19B12D76CB@livingcode.org> On 4-Dec-06, at 8:00 AM, Craig Amundsen wrote: > I've tried that. I'm trying to move my library from one external > Firewire > drive to an external RAID1 setup. Doing the consolidate moved about > 10% of > the files and then crapped out with an error that said something > about being > able to read/write a drive. Repeated attempts to consolidate the > library now > die with the read/write error immediately. I don't think it's a > problem with > either drive since I can read and write from both of them. It may > be that > RAID is too slow to keep up with whatever iTunes is trying to do. I > was > hoping I could do a manual copy and then update all the locations via > appscript. This having the advantage of allowing me to preserve > metadata. I > guess it's time to forget about the metadata since I'm not going to > do the > one-at-a-time location update from within iTunes. Can you set the metadata from AppScript? I'm assuming you can, but haven't been following this thread that closely. You could try backing up your iTunes/iTunes Music Library.xml file and write a script to parse it and set the metadata on your files once you've moved them. It looks like a standard plist file, so you can use the python plist library to do the parsing. I'm sure the unique Track ID will be different, but you could key off artist + title + size and reset the other information (play counts, rating, etc.). I'm pretty sure iTunes reads this file on startup to set up its internal database, but I don't have time to test this theory right now. If that doesn't work, there still may be value in thinking outside the AppScript box. --Dethe Windows has detected the mouse has moved. Please restart your system for changes to take effect. From altern2 at gmail.com Tue Dec 5 11:07:27 2006 From: altern2 at gmail.com (altern) Date: Tue, 05 Dec 2006 11:07:27 +0100 Subject: [Pythonmac-SIG] weird pygame problem on 10.4 Message-ID: <457544DF.30607@gmail.com> hi all I just upgraded my old mac laptop to 10.4.8 from 10.3.9. I am running pygame + pyopengl scripts and I find this weird error that did not happen on 10.3.9. The 'canvas', the surface were the drawing happens it is misplaced within the window by 100 px to the right and 100 px to the top. So I get a 100 px wide empty band on the left bottom of the window. If I run the same script using wxPython instead of pygame to handle the window events there is no problem at all. The funny thing is that neither the pygame or the pyOpenGL examples have this problem, so it must be my code. But I dont really know where to start debugging from. I am running python 2.4 and i installed all the stuff from http://www.pythonmac.org/packages/py24-fat/index.html including : python-2.4.4-macosx2006-10-18.dmg pygame-1.8.0pre-py2.4-macosx10.4.zip PyOpenGL-2.0.2.01-py2.4-macosx10.4.zip any hints would be very much appreciated thanks! enrike From ronaldoussoren at mac.com Wed Dec 6 07:39:11 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 6 Dec 2006 07:39:11 +0100 Subject: [Pythonmac-SIG] py2app and haxies Message-ID: <6BAC4E30-C17B-47B1-906E-1983531231AD@mac.com> Hi, The current release of py2app doesn't mix well[1] with haxies and other backdoor mechanism's to insert code into applications (such as rogue input managers). I've checked in a workaround in the py2app repository, updating to 'py2app==dev' should be safe as there isn't much development at the moment. Ronald [1] Aka "my application crashes when a haxie is present" -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061206/20da8449/attachment.bin From bthom at cs.hmc.edu Thu Dec 7 08:27:41 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Wed, 06 Dec 2006 23:27:41 -0800 Subject: [Pythonmac-SIG] using matplotlib, ipython, etc. w/MacPython Message-ID: <50CA97C7-2B53-4CB2-924B-FD9E965C8214@cs.hmc.edu> Hi, I've spent the last 2 weeks wrestling w/macports python/packages. Today, in advice to a question, Robert Kern advised that I use the MacPython "official" distribution. I now need to quickly get MacPython up to the (hopefully less buggy) state than where I had gotten w/the macports setup. Specifically, I need to: 1) use matplotlib interactively, which requires something like TkAgg or WxAgg. (W/macports WxAgg is the only backend that works) 2) have python access to Tk (aka tkinter) 3) have ipython 4) have Numeric access I'd also be interested in numpy/scipy if it is an easy install. I'm entirely new to Tk, so there could use more detailed advice. I did find a useful blurb on http://matplotlib.sourceforge.net/ installing.html (appended), but alas: 1) pythonmac.org/packages server is not responding 2) the MacEnthon link leads to a page that has yet to be created 3) the "step-by-step" link says "under revision; come back soon" Perhaps the Moad bundle will work? Advice gratefully appreciated. --b -------------- All of the backends run on OS X. Chris Barker has built a binary package (fink users see below) for matplotlib which is hosted on pythonmac, and works with Agg, Wx and Tk; see the step-by-step instructions kindly provided by Michael Tobis. It does not included the GTK* backends, because pygtk is usually provided through fink and/ or darwinport. This version should work on an stock OS-X 10.3.*, and you need Numeric or numarray (available on the same site), and TK or wxPython, if you want to use those back ends. There are other binary packages to look at which each have different components included. Robery Kern has built an all-in-one installer which includes scipy, Numeric, numarray, matplotlib, ipython, VTK, MayaVi, PIL, the enthought tool suite and much more; see >MacEnthon. Charlie Moad has bundled matplotlib with freetype, png, wx, numarray, numeric and doesn't rely on fink or darwinports; available in the Tools Section. Another bundle is scisoft which packages many scientific packages for python on OS X, including matplotlib, although it is designed for astronomical analysis. If you want to compile yourself on OS X, make sure you read the compiling instructions above. You will need to install freetype2, libpng and zlib via fink or from src, or from a package manager such as fink or i-Installer. You will also need the base libraries for a given backend. Eg, if you want to run TkAgg, you will need a python with Tkinter; if you want to use WxAgg, install wxpython. See backends for a more comprehensive discussion of the various backend requirements. Edit setup.py to configure the backends you want to build as described above. Note when running a GUI backend in OSX, you should launch your programs with pythonw rather than python, or you may get nonresponsive GUIs. ----- I do not want to compile code myself unless absolutely necessary. I was wondering what was up with the "MacEnton" suite; clicking on the link described at the above web page informs me that the "MacEnthon" page does not exist. From robert.kern at gmail.com Thu Dec 7 08:38:39 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 07 Dec 2006 01:38:39 -0600 Subject: [Pythonmac-SIG] using matplotlib, ipython, etc. w/MacPython In-Reply-To: <50CA97C7-2B53-4CB2-924B-FD9E965C8214@cs.hmc.edu> References: <50CA97C7-2B53-4CB2-924B-FD9E965C8214@cs.hmc.edu> Message-ID: belinda thom wrote: > I do not want to compile code myself unless absolutely necessary. I > was wondering what was up with the "MacEnton" suite; clicking on the > link described at the above web page informs me that the "MacEnthon" > page does not exist. Umm, ignore it. It targetted a now-old Python distribution, and I don't have time to update it anymore. References recommending it should be removed. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From bob at redivi.com Thu Dec 7 08:58:21 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 7 Dec 2006 15:58:21 +0800 Subject: [Pythonmac-SIG] using matplotlib, ipython, etc. w/MacPython In-Reply-To: <50CA97C7-2B53-4CB2-924B-FD9E965C8214@cs.hmc.edu> References: <50CA97C7-2B53-4CB2-924B-FD9E965C8214@cs.hmc.edu> Message-ID: <6a36e7290612062358g5c5c50ddia658ef37ffa0e7b7@mail.gmail.com> On 12/7/06, belinda thom wrote: > > 1) pythonmac.org/packages server is not responding Works fine here. -bob From bthom at cs.hmc.edu Thu Dec 7 09:29:58 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Thu, 07 Dec 2006 00:29:58 -0800 Subject: [Pythonmac-SIG] pythonmac packages question Message-ID: Hi, As of my prior post, I was able to get into pythonmac.org. There I found many of the packages it seems I'll need. I was able to install Numeric and WxPython (I chose the later dmg, v 2.7.1.3) and matplotlib. This site has no Tkinter and no IPython packages. Where do MacPython people go for such things? Meanwhile... If I run python alone and try out pylab, I get the following errors: ---------------- 85 % python Python 2.4.4 (#1, Oct 18 2006, 10:34:39) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin [snip] >>> import pylab >>> pylab.plot([1,2,3],[10,20,30]) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/matplotlib/axes.py:1223: UserWarning: xmax too close to xmin; adjusting warnings.warn("xmax too close to xmin; adjusting") Traceback (most recent call last): File "/Library/Frameworks/ Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/ axes.py", line 1227, in set_xlim self.viewLim.intervalx().set_bounds(xmin, xmax) TypeError: only length-1 arrays can be converted to Python scalars. ------------------ I've read elsewhere IPython is the rec'd way to use pylab b/c it sets up some needed things like an extra thread. As a temporary hack, I added a symlink to /Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages that points to the macports IPython install I'd done previously. This seems to work (ipython runs). However, when I do: ------------------- 4 % ipython -pylab /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/IPython/Shell.py:709: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or activly maintained. Please switch to the wx package as soon as possible. import wxPython.wx as wx Python 2.4.4 (#1, Oct 18 2006, 10:34:39) Type "copyright", "credits" or "license" for more information. [snikp] IPython 0.7.2 -- An enhanced Interactive Python. Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [1]: from pylab import * In [2]: plot([1,2,3]) [snip] exceptions.MemoryError Traceback (most recent call last) [snip] /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/matplotlib/backends/backend_wx.py in _onPaint(self, evt) MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the wx.Bitmap > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ site-packages/matplotlib/backends/backend_wxagg.py(63)draw() 62 ---> 63 self.bitmap = _convert_agg_to_wx_bitmap (self.get_renderer(), None) 64 if repaint: ---------- The initial warning implies the MacPython stuff isn't happy with macport's IPython's. I'm confused as to how to proceed. Advice greatly appreciated. --b From njriley at uiuc.edu Thu Dec 7 09:35:10 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Thu, 7 Dec 2006 02:35:10 -0600 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: References: Message-ID: <20061207083510.GB52065@uiuc.edu> On Thu, Dec 07, 2006 at 12:29:58AM -0800, belinda thom wrote: > This site has no Tkinter and no IPython packages. Where do MacPython > people go for such things? Tkinter comes with MacPython; you don't need to install it separately. For IPython, just use easy_install. You may need to add Python's bin directory to your path, depending on how you configure it. -- Nicholas Riley | From ronaldoussoren at mac.com Thu Dec 7 09:38:44 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 7 Dec 2006 09:38:44 +0100 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: References: Message-ID: <75A0405E-EE3E-4E6F-8A65-B48025011AD3@mac.com> On Dec 7, 2006, at 9:29 AM, belinda thom wrote: > > This site has no Tkinter and no IPython packages. Where do MacPython > people go for such things? tkinter is part of the standard installation for macpython. Ronald From bthom at cs.hmc.edu Thu Dec 7 09:38:36 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Thu, 07 Dec 2006 00:38:36 -0800 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: References: <20061207083510.GB52065@uiuc.edu> Message-ID: <07B00F4F-0ECE-48D9-886D-5A9DAE290FF9@cs.hmc.edu> Whoops, forgot to reply to the forum... On Dec 7, 2006, at 12:36 AM, belinda thom wrote: > Thanks Nicholas, > > So how do I use easy install :-)? > > On Dec 7, 2006, at 12:35 AM, Nicholas Riley wrote: > >> For IPython, just use easy_install. You may need to add Python's bin >> directory to your path, depending on how you configure it. > From njriley at uiuc.edu Thu Dec 7 09:48:16 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Thu, 7 Dec 2006 02:48:16 -0600 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: <07B00F4F-0ECE-48D9-886D-5A9DAE290FF9@cs.hmc.edu> References: <20061207083510.GB52065@uiuc.edu> <07B00F4F-0ECE-48D9-886D-5A9DAE290FF9@cs.hmc.edu> Message-ID: <20061207084816.GA52585@uiuc.edu> On Thu, Dec 07, 2006 at 12:38:36AM -0800, belinda thom wrote: > On Dec 7, 2006, at 12:36 AM, belinda thom wrote: > > >Thanks Nicholas, > > > >So how do I use easy install :-)? Of particular importance is the section on "custom installation locations": Before starting you probably want to edit the ~/.pydistutils.cfg file to specify a different location for installing scripts (for example, /usr/local/bin). If you just want to install the packages for yourself, then check out the Mac OS X "User" installation section. Then download and run ez_setup.py, which bootstraps setuptools, and run "easy_install IPython". This will work with many simple packages, and some complex ones too. -- Nicholas Riley | From ronaldoussoren at mac.com Thu Dec 7 10:25:35 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 7 Dec 2006 10:25:35 +0100 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: <20061207084816.GA52585@uiuc.edu> References: <20061207083510.GB52065@uiuc.edu> <07B00F4F-0ECE-48D9-886D-5A9DAE290FF9@cs.hmc.edu> <20061207084816.GA52585@uiuc.edu> Message-ID: On Dec 7, 2006, at 9:48 AM, Nicholas Riley wrote: > On Thu, Dec 07, 2006 at 12:38:36AM -0800, belinda thom wrote: >> On Dec 7, 2006, at 12:36 AM, belinda thom wrote: >> >>> Thanks Nicholas, >>> >>> So how do I use easy install :-)? > > > > Of particular importance is the section on "custom installation > locations": > > installation-locations> > > Before starting you probably want to edit the ~/.pydistutils.cfg file > to specify a different location for installing scripts (for example, > /usr/local/bin). No you don't want that. Add /Library/Frameworks/Python.framework/ Versions/Current/bin to your shell's PATH, which the macpython installer should do automaticly. The major advantages of that are that all python stuff is nicely self- contained in the python framework and it is possible to do side-by- side installations of multiple versions of python (such as Python 2.4 and 2.5). Ronald From bthom at cs.hmc.edu Thu Dec 7 11:21:31 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Thu, 07 Dec 2006 02:21:31 -0800 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: References: <20061207083510.GB52065@uiuc.edu> <07B00F4F-0ECE-48D9-886D-5A9DAE290FF9@cs.hmc.edu> <20061207084816.GA52585@uiuc.edu> Message-ID: Thanks folks....the saga continues... > No you don't want that. Add /Library/Frameworks/Python.framework/ > Versions/Current/bin to your shell's PATH, which the macpython > installer should do automaticly. > > The major advantages of that are that all python stuff is nicely > self-contained in the python framework and it is possible to do > side-by-side installations of multiple versions of python (such as > Python 2.4 and 2.5). > > Ronald I've gotten easy-install running, which allowed me to download a brand-spanking new version of ipython (0.7.2). Recall I've also installed (via http://pythonmac.org/packages/py24-fat/index.html) matplotlib, Numeric, and wxPython (the latest version: 2.7.1.3; there was also a 2.6.3.3 version). I run my new ipython with the -pylab option (using WXAgg backend and interactive True) and still get the following warning: --------- /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/ipython-0.7.2-py2.4.egg/IPython/Shell.py:709: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or activly maintained. Please switch to the wx package as soon as possible. import wxPython.wx as wx ---------- followed by the same ability to not be able to use matplotlib commands, e.g. from pylab import * plot([1,2,3]) gives the same Memory / wx error: ------- In [3]: exceptions.MemoryError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/matplotlib/backends/backend_wx.py in _onPaint(self, evt) 1046 self.realize() 1047 # Render to the bitmap -> 1048 self.draw(repaint=False) 1049 # Update the display using a PaintDC 1050 self.gui_repaint(drawDC=wx.PaintDC(self)) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/matplotlib/backends/backend_wxagg.py in draw(self, repaint) 61 FigureCanvasAgg.draw(self) 62 ---> 63 self.bitmap = _convert_agg_to_wx_bitmap (self.get_renderer(), None) 64 if repaint: 65 self.gui_repaint() MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the wx.Bitmap -------- I also tried using the TkAgg backend, which produces very different complaints, e.g: ---------------- In [16]: rcParamsDefault['backend'] Out[16]: 'TkAgg' In [18]: plot([1,2,3]) exceptions.TypeError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/matplotlib/axes.py in set_xlim(self, xmin, xmax, emit) 1225 xmax += 1e-38 1226 -> 1227 self.viewLim.intervalx().set_bounds(xmin, xmax) 1228 if emit: self._send_xlim_event() 1229 return xmin, xmax TypeError: only length-1 arrays can be converted to Python scalars. ----------------- Have any of you been able to use matplotlib w/ipython in the MacPorts setting? What am I doing incorrectly? Thanks again, --b From kw at codebykevin.com Thu Dec 7 13:50:27 2006 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 07 Dec 2006 07:50:27 -0500 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: <75A0405E-EE3E-4E6F-8A65-B48025011AD3@mac.com> References: <75A0405E-EE3E-4E6F-8A65-B48025011AD3@mac.com> Message-ID: <45780E13.6070900@codebykevin.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > tkinter is part of the standard installation for macpython. > What does this mean? Does MacPython 2.5 now install a universal build of the Tcl/Tk frameworks in /Library/Frameworks? - -- Kevin Walzer Code by Kevin http://www.codebykevin.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFeA4TEsLm8HXyq4sRAr6AAJsErqcP7BcUEYlH3LpzBtnj/rXktACgh2dp m17UbFdUdXOk7vfeR5PHh0w= =SRIb -----END PGP SIGNATURE----- From ronaldoussoren at mac.com Thu Dec 7 14:24:11 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 7 Dec 2006 14:24:11 +0100 Subject: [Pythonmac-SIG] pythonmac packages question In-Reply-To: <45780E13.6070900@codebykevin.com> References: <75A0405E-EE3E-4E6F-8A65-B48025011AD3@mac.com> <45780E13.6070900@codebykevin.com> Message-ID: <033E2123-B805-4CBC-9C98-9A1975A10877@mac.com> On Dec 7, 2006, at 1:50 PM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > >> tkinter is part of the standard installation for macpython. >> > > > What does this mean? Does MacPython 2.5 now install a universal > build of > the Tcl/Tk frameworks in /Library/Frameworks? No it means that MacPython ships with _tkinter.so. If you're running on a 10.3 system you still have to install Tcl/Tk by hand. Either way you're hosed because the Aqua version of Tk sucks. Ronald From rowen at cesmail.net Thu Dec 7 18:40:14 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 07 Dec 2006 09:40:14 -0800 Subject: [Pythonmac-SIG] pythonmac packages question References: Message-ID: In article , belinda thom wrote: > Hi, > > As of my prior post, I was able to get into pythonmac.org. > > There I found many of the packages it seems I'll need. I was able to > install Numeric and WxPython (I chose the later dmg, v 2.7.1.3) and > matplotlib. > > This site has no Tkinter and no IPython packages. Where do MacPython > people go for such things? Tkinter is already included with MacPython. It will use the built-in (crummy) Aqua Tcl/Tk or you can install a newer better version. ActiveState recently released 8.4.14 as a universal binary (the first universal binary version), which is handy if you want to redistribute your code. So far it seems pretty robust, though it does have a few known bugs. -- Russell From lou_boog2000 at yahoo.com Fri Dec 8 16:33:47 2006 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Fri, 8 Dec 2006 07:33:47 -0800 (PST) Subject: [Pythonmac-SIG] [SciPy-user] C-extensions for NumPy code available. Message-ID: <364838.73688.qm@web34407.mail.mud.yahoo.com> For those of you who do numerical calculations, need to speed up your code, and use NumPy arrays: I've written several C extensions that handle NumPy arrays. They are simple, but they seem to work well. They will show you how to pass Python variables and NumPy arrays to your C code. Once you learn how to do it, it's pretty straight-forward. I suspect they will suffice for most numerical code. I've written it up as a draft and have made the code and document file available. If you want a copy, just email me or post a followup here to this message. I will send it to you as a tar.gzip file (only 192 KB). Remember it is only a draft (no guarantees or warantees) and you should test the code for your own uses. I would really love people who are much more knowledgable about these things than I to look it over and set me straight on any mistakes (like not INREF'ing something). In addition, is there a place I could put this up on the web for others? I don't have any way to do that at my lab. I would like to share with the Python community since I've been helped so much on these mailing lists. By the way I did this after a long time of searching for ways to speed up Python and connect with my C and C++ code. There are a lot of solutions out there, but I decided that they all provided so much more than I needed and required so much more learning time that it wasn't worth it. I am not knocking them. I found for my numerical needs I really only need to pass a limited set of things (integers, floats, strings, and NumPy arrays). If that's your category, this code might help you. -- Lou Pecora Naval Research Lab Washington, DC ____________________________________________________________________________________ Need a quick answer? Get one in minutes from people who know. Ask your question on www.Answers.yahoo.com From lou_boog2000 at yahoo.com Fri Dec 8 17:44:00 2006 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Fri, 8 Dec 2006 08:44:00 -0800 (PST) Subject: [Pythonmac-SIG] [SciPy-user] C-extensions for NumPy code available. In-Reply-To: <45798E9A.9050600@gmail.com> Message-ID: <195291.33451.qm@web34415.mail.mud.yahoo.com> This is a good idea, but I'm afraid I have no idea how to even start this process. I've never done anything on a Wiki. Is there some tutorial for newbies like me? Maybe I missed a link to one there. Thanks. -- Lou Pecora --- Robert Kern wrote: > Temporarily, you can write up a wiki page about it > on www.scipy.org and attach > the tarball to the page. Once we can look at the > contents a bit more, we might > have better ideas where they can go. Possibly, they > can go into the numpy > distribution as examples. > > -- > Robert Kern ____________________________________________________________________________________ Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now. From Larry.A.Meyn at nasa.gov Fri Dec 8 18:49:30 2006 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Fri, 8 Dec 2006 09:49:30 -0800 Subject: [Pythonmac-SIG] [SciPy-user] C-extensions for NumPy code available. In-Reply-To: <195291.33451.qm@web34415.mail.mud.yahoo.com> References: <195291.33451.qm@web34415.mail.mud.yahoo.com> Message-ID: Lou, I've never used the SciPy wiki, but it's similar to the one I use. Hopefully this will give you a start. First you need an account. For that go to http://www.scipy.org/ UserPreferences and enter your information. To edit pages click on the little balloon icon in the upper right. Help on editing can be found at http://www.scipy.org/HelpOnEditing Good luck and thanks for donating you code. Larry On Dec 8, 2006, at 8:44 AM, Lou Pecora wrote: > This is a good idea, but I'm afraid I have no idea how > to even start this process. I've never done anything > on a Wiki. Is there some tutorial for newbies like > me? Maybe I missed a link to one there. > > Thanks. > > -- Lou Pecora > > --- Robert Kern wrote: > >> Temporarily, you can write up a wiki page about it >> on www.scipy.org and attach >> the tarball to the page. Once we can look at the >> contents a bit more, we might >> have better ideas where they can go. Possibly, they >> can go into the numpy >> distribution as examples. >> >> -- >> Robert Kern > > > > > ______________________________________________________________________ > ______________ > Any questions? Get answers on any topic at www.Answers.yahoo.com. > Try it now. > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061208/3c6080fc/attachment.htm From bthom at cs.hmc.edu Sun Dec 10 02:37:39 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Sat, 09 Dec 2006 17:37:39 -0800 Subject: [Pythonmac-SIG] eggs and extraction Message-ID: Hi, I've installed matplotlib from http://pythonmac.org/packages/py24- fat/. Things are running finally. [Details: I ran into a problem where backend TkAgg and numerix Numeric didn't get along; to the best of my knowledge this problem is undocumented; my stuff worked w/TkAgg only after I changed to numerix numpy; I couldn't get wxPython w/ matplotlib and WXAgg to work at all]. Now I can't figure out how to access the documentation. Part of the problem is that I'm pretty confused about what an egg is (I've scanned easy_install and distutil related stuff, but learned little; I'm not even sure where to look; Google often brings up content that deals w/chicken eggs :-) In particular, I wanted to look at matplotlib's two_scales.py. In site-packages, I've got a matplotlib-0.87.7-py2.4.egg-info/ SOURCES.txt, which contains the line: examples/two_scales.py I had thought perhaps: easy_install -editable matplotlib-0.87.7-py2.4.egg-info/ would do the trick, but it complains: error: No urls, filenames, or requirements specified (see --help) What do I have to do to install all the examples onto my machine? Thanks, --b From robert.kern at gmail.com Sun Dec 10 02:54:37 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 09 Dec 2006 19:54:37 -0600 Subject: [Pythonmac-SIG] eggs and extraction In-Reply-To: References: Message-ID: belinda thom wrote: > Now I can't figure out how to access the documentation. Part of the > problem is that I'm pretty confused about what an egg is (I've > scanned easy_install and distutil related stuff, but learned little; > I'm not even sure where to look; Google often brings up content that > deals w/chicken eggs :-) The documentation and examples were not included in the binary distribution that you installed. You can get them from the source distribution. http://sourceforge.net/project/showfiles.php?group_id=80706 The first 7 or so hits on a Google search for "python eggs" are all on-topic and tell you what you want to know about eggs (although they won't tell you where to get matplotlib documentation and examples). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robert.kern at gmail.com Sun Dec 10 02:56:07 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 09 Dec 2006 19:56:07 -0600 Subject: [Pythonmac-SIG] eggs and extraction In-Reply-To: References: Message-ID: belinda thom wrote: > I had thought perhaps: > > easy_install -editable matplotlib-0.87.7-py2.4.egg-info/ > > would do the trick, but it complains: > > error: No urls, filenames, or requirements specified (see --help) And the appropriate form for this command is the following: [src]$ easy_install --editable -b . matplotlib Searching for matplotlib Reading http://www.python.org/pypi/matplotlib/ Reading http://matplotlib.sourceforge.net Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Reading http://www.python.org/pypi/matplotlib/0.87.7 Best match: matplotlib 0.87.7 Downloading http://downloads.sourceforge.net/matplotlib/matplotlib-0.87.7.tar.gz?modtime=1161866270&big_mirror=0 Processing matplotlib-0.87.7.tar.gz Extracted editable version of matplotlib to ./matplotlib If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python setup.py develop See the setuptools documentation for the "develop" command for more info. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From niko at alum.mit.edu Sun Dec 10 08:25:48 2006 From: niko at alum.mit.edu (Niko Matsakis) Date: Sun, 10 Dec 2006 08:25:48 +0100 Subject: [Pythonmac-SIG] py2app plugin problem: "Error loading code" Message-ID: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> All of a sudden, for reasons I completely fail to understand, py2app- created plug-ins will no longer load in my application. I am not 100% sure if this is the right list for this kind of question: feel free to set me straight. The error I get is as follows: 2006-12-09 17:10:59.988 drachma[25673] *** -[NSBundle load]: Error loading code /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/ Contents/Resources/PyPlugin.plugin/Contents/MacOS/PyPlugin for bundle /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/ Contents/Resources/PyPlugin.plugin, error code 2 (link edit error code 0, error number 0 ()) The only slightly strange thing I noticed is that when I use "file" on the content of the plugin I get: /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/Contents/ Resources/PyPlugin.plugin/Contents/MacOS/PyPlugin: Mach-O bundle i386 Which says "i386", but this is running on a PPC. I tried to use the "--prefer-ppc" option, but I get the same result either way. Any ideas on what's wrong, or where to find more information? It doesn't seem to matter whether I use -A mode or not. I am using a version of Python 2.4 from DarwinPorts; PyObjC was installed the same way. What's very odd is that all of this USED to work --- I had to do a bit of a hack to make the -A mode work, introducing a .pth file into ~/Library/Python/2.4/site-packages, but now nothing works, whether or not I add or remove that file. The only thing I can think of that I did in between is to attempt to build a "Release" version of the program instead of a "Debug" version, but now neither Release nor Debug works. thanks in advance for any clues, Niko From robert.kern at gmail.com Fri Dec 8 17:11:06 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 08 Dec 2006 10:11:06 -0600 Subject: [Pythonmac-SIG] [SciPy-user] C-extensions for NumPy code available. In-Reply-To: <364838.73688.qm@web34407.mail.mud.yahoo.com> References: <364838.73688.qm@web34407.mail.mud.yahoo.com> Message-ID: <45798E9A.9050600@gmail.com> Lou Pecora wrote: > In addition, is there a place I could put this up on > the web for others? I don't have any way to do that > at my lab. I would like to share with the Python > community since I've been helped so much on these > mailing lists. Temporarily, you can write up a wiki page about it on www.scipy.org and attach the tarball to the page. Once we can look at the contents a bit more, we might have better ideas where they can go. Possibly, they can go into the numpy distribution as examples. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From cmiller at securityevaluators.com Sat Dec 9 03:30:33 2006 From: cmiller at securityevaluators.com (Charlie Miller) Date: Fri, 08 Dec 2006 20:30:33 -0600 Subject: [Pythonmac-SIG] Python on mac - can't extend interpreter with "catch_exception_raise" wrapper. Message-ID: <457A1FC9.9040803@securityevaluators.com> Hi. I've run into a very strange problem with Python on the mac. I'm trying to write a python script which will monitor an application for exceptions. It turns out on a mac, to do this you want to use the Mach IPC interface, see: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/ http://www.wodeveloper.com/omniLists/macosx-dev/2000/June/msg00137.html Once set up, you call the mach function exc_server which then calls "catch_raise_exception" which you provide. This works great in C, so I thought I'd wrap it for python. But, it turns out the python interpreter already has a symbol named "catch_raise_exception", (in my case at 0x2030 under gdb). The problem is when exc_server calls catch_raise_exception it calls the one from the python binary and not the one I provided and dies. Does anyone have any ideas on how to deal with this perplexing problem?!? Thanks!!! Charlie From niko at alum.mit.edu Sun Dec 10 22:19:15 2006 From: niko at alum.mit.edu (Niko Matsakis) Date: Sun, 10 Dec 2006 22:19:15 +0100 Subject: [Pythonmac-SIG] py2app plugin problem: "Error loading code" In-Reply-To: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> References: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> Message-ID: <7C1340EA-9112-4728-A693-E8BD9296574A@alum.mit.edu> As a follow up, I decided to see if the problem was related to my project in any way by followiing the tutorial at http:// pyobjc.sourceforge.net/doc/extending_objc_with_python.php. I still get the same error, so it must be something in my machine. I can't seem to find any kind of reference to what "error code 2" might mean.... Niko On Dec 10, 2006, at 8:25 AM, Niko Matsakis wrote: > All of a sudden, for reasons I completely fail to understand, py2app- > created plug-ins will no longer load in my application. I am not > 100% sure if this is the right list for this kind of question: feel > free to set me straight. > > The error I get is as follows: > > 2006-12-09 17:10:59.988 drachma[25673] *** -[NSBundle load]: Error > loading code /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/ > Contents/Resources/PyPlugin.plugin/Contents/MacOS/PyPlugin for > bundle /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/ > Contents/Resources/PyPlugin.plugin, error code 2 (link edit error > code 0, error number 0 ()) > > The only slightly strange thing I noticed is that when I use "file" > on the content of the plugin I get: > > /Users/niko/hg/proj/drachma/src/build/Debug/drachma.app/Contents/ > Resources/PyPlugin.plugin/Contents/MacOS/PyPlugin: Mach-O bundle i386 > > Which says "i386", but this is running on a PPC. I tried to use the > "--prefer-ppc" option, but I get the same result either way. > > Any ideas on what's wrong, or where to find more information? It > doesn't seem to matter whether I use -A mode or not. > > I am using a version of Python 2.4 from DarwinPorts; PyObjC was > installed the same way. > > What's very odd is that all of this USED to work --- I had to do a > bit of a hack to make the -A mode work, introducing a .pth file into > ~/Library/Python/2.4/site-packages, but now nothing works, whether or > not I add or remove that file. The only thing I can think of that I > did in between is to attempt to build a "Release" version of the > program instead of a "Debug" version, but now neither Release nor > Debug works. > > > thanks in advance for any clues, > > Niko > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From ronaldoussoren at mac.com Sun Dec 10 22:37:21 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 10 Dec 2006 22:37:21 +0100 Subject: [Pythonmac-SIG] py2app plugin problem: "Error loading code" In-Reply-To: <7C1340EA-9112-4728-A693-E8BD9296574A@alum.mit.edu> References: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> <7C1340EA-9112-4728-A693-E8BD9296574A@alum.mit.edu> Message-ID: <50193F5C-BDEF-4C33-BF27-E553CD76304C@mac.com> On Dec 10, 2006, at 10:19 PM, Niko Matsakis wrote: > As a follow up, I decided to see if the problem was related to my > project in any way by followiing the tutorial at http:// > pyobjc.sourceforge.net/doc/extending_objc_with_python.php. I still > get the same error, so it must be something in my machine. > > I can't seem to find any kind of reference to what "error code 2" > might mean.... The problem is that py2app/bundletemplate/prebuild/main in the py2app distribution is an intel-only binary (at least in the current trunk) instead of a universal binary. Removing the file and running 'setup.py' in the bundletemplate directory should rebuild it with the proper architecture for your machine. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061210/ec3240ce/attachment.bin From niko at alum.mit.edu Sun Dec 10 23:38:21 2006 From: niko at alum.mit.edu (Niko Matsakis) Date: Sun, 10 Dec 2006 23:38:21 +0100 Subject: [Pythonmac-SIG] py2app plugin problem: "Error loading code" In-Reply-To: <50193F5C-BDEF-4C33-BF27-E553CD76304C@mac.com> References: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> <7C1340EA-9112-4728-A693-E8BD9296574A@alum.mit.edu> <50193F5C-BDEF-4C33-BF27-E553CD76304C@mac.com> Message-ID: <01ED529F-AF16-464F-8B8B-A5014195EEF5@alum.mit.edu> > > The problem is that py2app/bundletemplate/prebuild/main in the > py2app distribution is an intel-only binary (at least in the > current trunk) instead of a universal binary. Okay, I must say, I would *never* have guessed that! I wonder how that file changed? As I said, this used to work... perhaps DarwinPorts took it upon itself to upgrade py2app in some way? In any case, after doing your setup.py trick, everything seemed better. Thanks a lot! Now, next question: to get python imports to work and the python bundle to start, I found I have to add a symbolic link from "Contents/Resources/Python" to "Contents/Resources/lib/python2.4". While I can do this if necessary, do you have any idea why things don't just end up in the right places on their own? Is DarwinPorts not the best way to go about using things, anyhow? It seems that most things don't really work too smoothly. If so, what is the recommended configuration? Niko From bthom at cs.hmc.edu Mon Dec 11 07:09:16 2006 From: bthom at cs.hmc.edu (belinda thom) Date: Sun, 10 Dec 2006 22:09:16 -0800 Subject: [Pythonmac-SIG] permissions on packages Message-ID: <21EC38A2-D0AB-4A66-B5E3-79075BAE2DC2@cs.hmc.edu> Hi, I'm writing to seek a better understanding of how permissions should work in python on the Mac. Out-of-the-MacPython-2.4-install box, files in /Library/Frameworks/ Python.framework/Versions/2.4/lib/python2.4 have permissions like these: -rw-rw-r-- 1 root admin 26255 Oct 18 01:39 zipfile.py -rw-rw-r-- 1 root admin 18931 Dec 6 22:14 zipfile.pyc -rw-rw-r-- 1 root admin 18931 Dec 6 22:14 zipfile.pyo In the site-packages directory, packages I installed (via macpython.com, e.g. numpy, Numeric, matplotlib, etc) have permissions like: drwxrwxr-x 41 501 admin 1394 Jul 5 20:11 Numeric/ drwxrwxr-x 157 501 admin 5338 Dec 9 20:57 matplotlib/ drwxr-xr-x 130 root admin 4420 Dec 7 04:39 numarray/ drwxrwxr-x 47 501 admin 1598 Oct 27 16:54 numpy/ drwxrwxr-x 6 501 admin 204 Oct 27 16:54 numpy-1.0-py2.4.egg- info/ -rw-rw-r-- 1 501 admin 31 Oct 26 06:26 pylab.py -rw-rw-r-- 1 501 admin 205 Oct 30 10:15 pylab.pyc -rw-rw-r-- 1 501 admin 205 Oct 30 10:15 pylab.pyo drwxrwxr-x 43 501 admin 1462 Sep 17 18:04 scipy/ drwxrwxr-x 6 501 admin 204 Sep 17 18:04 scipy-0.5.1- py2.4.egg-info/ drwxr-xr-x 10 bthom admin 340 Dec 7 01:33 setuptools-0.6c3- py2.4.egg/ -rw-r--r-- 1 bthom admin 29 Dec 7 01:33 setuptools.pth drwxrwxr-x 4 root admin 136 Jul 15 16:03 wx-2.6-mac-unicode/ -rw-r--r-- 1 root admin 18 Jul 15 16:03 wx.pth drwxr-xr-x 4 root admin 136 Jul 15 16:03 wxaddons/ -rw-r--r-- 1 root admin 17813 Jan 20 2006 wxversion.py Is there a reason why these packages have owner 501? And is there a reason why group have read access? I'd have thought the best way to install something that are supposed to work as-is would be to have root as owner, giving sole write permissions to owner. (Then to modify something, you'd have to sudo). I'm beginning to realize its not that simple. For instance, the first time I (w/admin privs) try and edit a file (e.g. zipfile.py), TextEdit asks if I'd like to overwrite the permissions on save. Saying yes overwrites the file. The disturbing thing is that on future opens (even after TextEdit's been closed) I am no longer asked; overwriting saves occur automatically. Fortunately, when I created another user w/o admin permissions, overwriting when logged in as this less priv'd user didn't seem to be an option. ...but I'd like to protect against myself (this is esp. true b/c I use ipython w/in xemacs w/%pdb on, so I'm often dumped into the editor w/a file like bpd.py). Some more poking in a package directory (e.g. matplotlib) shows permissions like: -rw-rw-r-- 1 root admin 40789 Oct 26 09:30 __init__.py -rw-r--r-- 1 bthom admin 39389 Dec 10 21:02 __init__.pyc -rw-rw-r-- 1 root admin 30134 Oct 30 10:15 __init__.pyo What's interesting here is that pyc is owned by me (perhaps b/c it was compiled via my first call to __init__.py). However, I'm pretty sure what I installed off macpython.com was binarys---so there should be no need to compile the files, right? Again, I (perhaps naively) would feel better if all of these files were owned by root (and that only root could override them). Security issues become even more important as students will be using python/ipython from the same machine. Perhaps I'm missing something really basic (would a Finder view to permissions provide better control?). Or perhaps the ability to not protect as tightly against myself as admin as I'd have liked is a "feature". What have others done wrt this issue? Thanks, --b From bob at redivi.com Mon Dec 11 07:21:17 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 11 Dec 2006 14:21:17 +0800 Subject: [Pythonmac-SIG] permissions on packages In-Reply-To: <21EC38A2-D0AB-4A66-B5E3-79075BAE2DC2@cs.hmc.edu> References: <21EC38A2-D0AB-4A66-B5E3-79075BAE2DC2@cs.hmc.edu> Message-ID: <6a36e7290612102221x49533c17jc8a648fcddd23870@mail.gmail.com> On 12/11/06, belinda thom wrote: > Hi, > > I'm writing to seek a better understanding of how permissions should > work in python on the Mac. > > Out-of-the-MacPython-2.4-install box, files in /Library/Frameworks/ > Python.framework/Versions/2.4/lib/python2.4 have permissions like these: > > -rw-rw-r-- 1 root admin 26255 Oct 18 01:39 zipfile.py > -rw-rw-r-- 1 root admin 18931 Dec 6 22:14 zipfile.pyc > -rw-rw-r-- 1 root admin 18931 Dec 6 22:14 zipfile.pyo > > In the site-packages directory, packages I installed (via > macpython.com, e.g. numpy, Numeric, matplotlib, etc) have permissions > like: > > drwxrwxr-x 41 501 admin 1394 Jul 5 20:11 Numeric/ > drwxrwxr-x 157 501 admin 5338 Dec 9 20:57 matplotlib/ > drwxr-xr-x 130 root admin 4420 Dec 7 04:39 numarray/ > drwxrwxr-x 47 501 admin 1598 Oct 27 16:54 numpy/ > drwxrwxr-x 6 501 admin 204 Oct 27 16:54 numpy-1.0-py2.4.egg- > info/ > -rw-rw-r-- 1 501 admin 31 Oct 26 06:26 pylab.py > -rw-rw-r-- 1 501 admin 205 Oct 30 10:15 pylab.pyc > -rw-rw-r-- 1 501 admin 205 Oct 30 10:15 pylab.pyo > drwxrwxr-x 43 501 admin 1462 Sep 17 18:04 scipy/ > drwxrwxr-x 6 501 admin 204 Sep 17 18:04 scipy-0.5.1- > py2.4.egg-info/ > drwxr-xr-x 10 bthom admin 340 Dec 7 01:33 setuptools-0.6c3- > py2.4.egg/ > -rw-r--r-- 1 bthom admin 29 Dec 7 01:33 setuptools.pth > drwxrwxr-x 4 root admin 136 Jul 15 16:03 wx-2.6-mac-unicode/ > -rw-r--r-- 1 root admin 18 Jul 15 16:03 wx.pth > drwxr-xr-x 4 root admin 136 Jul 15 16:03 wxaddons/ > -rw-r--r-- 1 root admin 17813 Jan 20 2006 wxversion.py > > Is there a reason why these packages have owner 501? And is there a > reason why group have read access? I'd have thought the best way to > install something that are supposed to work as-is would be to have > root as owner, giving sole write permissions to owner. (Then to > modify something, you'd have to sudo). > > I'm beginning to realize its not that simple. For instance, the first > time I (w/admin privs) try and edit a file (e.g. zipfile.py), > TextEdit asks if I'd like to overwrite the permissions on save. > Saying yes overwrites the file. The disturbing thing is that on > future opens (even after TextEdit's been closed) I am no longer > asked; overwriting saves occur automatically. Fortunately, when I > created another user w/o admin permissions, overwriting when logged > in as this less priv'd user didn't seem to be an option. > > ...but I'd like to protect against myself (this is esp. true b/c I > use ipython w/in xemacs w/%pdb on, so I'm often dumped into the > editor w/a file like bpd.py). > > Some more poking in a package directory (e.g. matplotlib) shows > permissions like: > > -rw-rw-r-- 1 root admin 40789 Oct 26 09:30 __init__.py > -rw-r--r-- 1 bthom admin 39389 Dec 10 21:02 __init__.pyc > -rw-rw-r-- 1 root admin 30134 Oct 30 10:15 __init__.pyo > > What's interesting here is that pyc is owned by me (perhaps b/c it > was compiled via my first call to __init__.py). However, I'm pretty > sure what I installed off macpython.com was binarys---so there should > be no need to compile the files, right? Again, I (perhaps naively) > would feel better if all of these files were owned by root (and that > only root could override them). > > Security issues become even more important as students will be using > python/ipython from the same machine. > > Perhaps I'm missing something really basic (would a Finder view to > permissions provide better control?). Or perhaps the ability to not > protect as tightly against myself as admin as I'd have liked is a > "feature". > > What have others done wrt this issue? That's not really intentional. If you want to fix it, feel free. The code that makes these packages is bdist_mpkg and the source is here: http://svn.pythonmac.org/bdist_mpkg/bdist_mpkg/trunk/ I don't have the time or the need to fix it myself any time soon. -bob From Chris.Barker at noaa.gov Mon Dec 11 19:29:33 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 11 Dec 2006 10:29:33 -0800 Subject: [Pythonmac-SIG] eggs and extraction In-Reply-To: References: Message-ID: <457DA38D.30506@noaa.gov> belinda thom wrote: > Details: I ran into a problem > where backend TkAgg and numerix Numeric didn't get along; to the best > of my knowledge this problem is undocumented; I don't think I've heard of it -- odd. > my stuff worked w/TkAgg > only after I changed to numerix numpy; numpy is a better option anyway, unless you need Numeric for legacy code. > I couldn't get wxPython w/ > matplotlib and WXAgg to work at all]. Darn. Unfortunately, MPL needs to be built with exactly the same version of wx that you run it with -- we've tried to keep the MPL and wx packages on pythonmac in sync, but they've gotten messed up. I hope someone will fix this, I'm not sure when I can, I still haven't set myself up with universal builds of the dependencies -- Charlie? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From rowen at cesmail.net Mon Dec 11 21:20:23 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Mon, 11 Dec 2006 12:20:23 -0800 Subject: [Pythonmac-SIG] cyptes problem on MacOS X Message-ID: I've been trying out ctypes (from MacPython 2.5) on MacOS X on a PPC Mac and have run into a problem. I hope I'm just doing something stupid, but it seems to match the tutorial so I'm really puzzled: import ctypes libc = ctypes.CDLL("libc.dylib") libc.printf("int=%d float=%f double=%f\n", ctypes.c_int(1), ctypes.c_float(2.0), ctypes.c_double(3.0)); results in: int=1 float=-1.996124 double=0.000000 I realize the docs doesn't actually claim to handle dylib files, but I've seen at least some info on the web that claims it works. One site suggested the need for ctypes.RTLD_GLOBAL to CDLL but adding it made no difference. On a related subject...assuming I can get this to work...does anyone have any idea how the speed of ctypes relates to programming a python C extension or using SWIG? This is mostly for use with NumPy and interfacing python to C/C++-based heavy duty astronomical image processing code. Other suggestions are welcome. We'll mostly be interfacing to C++ so I've considered trying out Boost, but it hasn't had an update in years which worries me. Robustness, ease of use and speed are all major requirements. Linux and MacOS X are the main platforms. -- Russell From pedz at easesoftware.com Mon Dec 11 21:39:24 2006 From: pedz at easesoftware.com (Perry Smith) Date: Mon, 11 Dec 2006 14:39:24 -0600 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: References: Message-ID: <18702D1C-0D2E-4B4B-9616-7F1CCD23BE30@easesoftware.com> I don't use floats and double much. But the printf man page implies that all floats are actually passed as doubles. I vaguely recall that to be the case. But I doubt if the python thingy knows that. Try not passing floats. You might also have problems trying to pass char's and short's (since they are promoted to int's). On Dec 11, 2006, at 2:20 PM, Russell E. Owen wrote: > I've been trying out ctypes (from MacPython 2.5) on MacOS X on a > PPC Mac > and have run into a problem. I hope I'm just doing something > stupid, but > it seems to match the tutorial so I'm really puzzled: > > import ctypes > libc = ctypes.CDLL("libc.dylib") > libc.printf("int=%d float=%f double=%f\n", ctypes.c_int(1), > ctypes.c_float(2.0), ctypes.c_double(3.0)); > > results in: > int=1 float=-1.996124 double=0.000000 > > I realize the docs doesn't actually claim to handle dylib files, but > I've seen at least some info on the web that claims it works. One site > suggested the need for ctypes.RTLD_GLOBAL to CDLL but adding it > made no > difference. > > On a related subject...assuming I can get this to work...does anyone > have any idea how the speed of ctypes relates to programming a > python C > extension or using SWIG? This is mostly for use with NumPy and > interfacing python to C/C++-based heavy duty astronomical image > processing code. > > Other suggestions are welcome. We'll mostly be interfacing to C++ so > I've considered trying out Boost, but it hasn't had an update in years > which worries me. Robustness, ease of use and speed are all major > requirements. Linux and MacOS X are the main platforms. > > -- Russell > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > Perry Smith ( pedz at easesoftware.com ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061211/273a9885/attachment.htm From rowen at cesmail.net Mon Dec 11 22:17:29 2006 From: rowen at cesmail.net (Russell E Owen) Date: Mon, 11 Dec 2006 13:17:29 -0800 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: <18702D1C-0D2E-4B4B-9616-7F1CCD23BE30@easesoftware.com> References: <18702D1C-0D2E-4B4B-9616-7F1CCD23BE30@easesoftware.com> Message-ID: At 2:39 PM -0600 2006-12-11, Perry Smith wrote: >I don't use floats and double much. But the printf man page implies that all >floats are actually passed as doubles. I vaguely recall that to be the case. > >But I doubt if the python thingy knows that. Try not passing >floats. You might >also have problems trying to pass char's and short's (since they are promoted >to int's). You're right. I should not have passed floats to printf. But the example also showed doubles being mishandled. Here is a more extensive example: import ctypes as ct libc = ct.CDLL("libc.dylib") libc.printf("int=%d double=%f\n", ct.c_int(1), ct.c_double(3.0)) libc.printf("int=%d double=%f double=%f\n", ct.c_int(1), ct.c_double(3.0), ct.c_double(3.0)) On MacOS X this prints: int=1 double=-1.996155 int=1 double=-1.996140 double=0.000000 On a linux box, with a suitably modified ct.CDLL statement, this produces the more reasonable: int=1 double=3.000000 int=1 double=3.000000 double=3.000000 I am totally mystified by the MacOS X results. -- Russell From pedz at easesoftware.com Mon Dec 11 22:36:28 2006 From: pedz at easesoftware.com (Perry Smith) Date: Mon, 11 Dec 2006 15:36:28 -0600 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: References: <18702D1C-0D2E-4B4B-9616-7F1CCD23BE30@easesoftware.com> Message-ID: Does this set up (python calling C code) have a way to introduce a C function prototype? I *think* that on the PPC, to call a function that has a variable number of arguments of mixed types, the compiler HAS to see the prototype so it knows to push the arguments on the stack and not pass them in registers. I'm getting old and I can't remember how the PPC guys solved this problem. The MIPs guys blew it. I think, the best I can recall, a function like: void f(double d); passes d in floating point register 0. A function like: void g(int i); passes i in general purpose register 3. (The next argument takes register 4, etc). But when the compile sees: int printf(char *f, ...); It says "oh I gotta pass everything on the stack". Try this: right a tiny C program. Do not include stdio.h. Do not include anything. Just call printf like you are calling it and see what happens. I bet it doesn't work. Then include stdio.h, and I bet it will magically start working. On Dec 11, 2006, at 3:17 PM, Russell E Owen wrote: > At 2:39 PM -0600 2006-12-11, Perry Smith wrote: >> I don't use floats and double much. But the printf man page >> implies that all >> floats are actually passed as doubles. I vaguely recall that to >> be the case. >> >> But I doubt if the python thingy knows that. Try not passing >> floats. You might >> also have problems trying to pass char's and short's (since they >> are promoted >> to int's). > > You're right. I should not have passed floats to printf. But the > example also showed doubles being mishandled. Here is a more > extensive example: > > import ctypes as ct > libc = ct.CDLL("libc.dylib") > libc.printf("int=%d double=%f\n", ct.c_int(1), ct.c_double(3.0)) > libc.printf("int=%d double=%f double=%f\n", ct.c_int(1), > ct.c_double(3.0), ct.c_double(3.0)) > > On MacOS X this prints: > int=1 double=-1.996155 > int=1 double=-1.996140 double=0.000000 > > On a linux box, with a suitably modified ct.CDLL statement, this > produces the more reasonable: > int=1 double=3.000000 > int=1 double=3.000000 double=3.000000 > > I am totally mystified by the MacOS X results. > > -- Russell > Perry Smith ( pedz at easesoftware.com ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems From cmiller at securityevaluators.com Mon Dec 11 23:43:06 2006 From: cmiller at securityevaluators.com (Charlie Miller) Date: Mon, 11 Dec 2006 16:43:06 -0600 Subject: [Pythonmac-SIG] Catching exceptions inside python with catch_exception_raise() doesn't work Message-ID: <506DCEAC-1E98-4084-B378-58537E3A4148@securityevaluators.com> Is it possible to monitor for exceptions using the Mac OS X catch_exception_raise function inside python? As you may know, after some setup, this function gets called whenever an exception occurs. I have a program which works great in C but when I wrap it in python it fails. This is due to the fact that it calls exc_server, which uses _dyld_lookup_and_bind, to try to find the location of the function catch_exception_raise. When wrapped in python, dyld_lookup_and_bind returns 0x2030 which is NOT the correct address. It then jumps there and tries executing which causes a BUS ERROR. In C at least, dyld_lookup_and_bind works if the catch_exception_raise function is compiled into the binary or linked dynamically at runtime via a shared library (dylib). However, it doesn't work if it is brought into the executable space via dlopen - which presumably is how python does it. How can I set it up so that I can monitor applications for exceptions in a python script? I could fork and exec a program with its own address space, but that seems ridiculous. I could recompile the python interpreter and include catch_exception_raise, but that also seems terrible. Or is it impossible to wrap such a program in python - which seems silly? Any help is appreciated. Thanks, Charlie From Chris.Barker at noaa.gov Tue Dec 12 01:21:15 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 11 Dec 2006 16:21:15 -0800 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: References: Message-ID: <457DF5FB.9040105@noaa.gov> Russell E. Owen wrote: > I've been trying out ctypes (from MacPython 2.5) on MacOS X on a PPC Mac > and have run into a problem. I'm no help here. > On a related subject...assuming I can get this to work...does anyone > have any idea how the speed of ctypes relates to programming a python C > extension or using SWIG? probably a bit better performance for ctypes -- swig does put a fair bit between C and Python. > This is mostly for use with NumPy and > interfacing python to C/C++-based heavy duty astronomical image > processing code. In this case, you'll mostly be passing large arrays back and forth -- I doubt the overhead of any wrapping technique will be noticeable. That being the case, what you want is whatever is most comfortable for you. > We'll mostly be interfacing to C++ so > I've considered trying out Boost, but it hasn't had an update in years > which worries me. I'm pretty sure that someone has updated the boost array code for numpy, but I'm not sure where to find that out. I'd ask on the numpy list - if no one there is using it, I'd call it risky. You might also look at the C++-sig -- there's been discussion of this there recently. pyrex is another candidate worth looking at. There should be examples on the scipy Wiki. This has been my way of thinking: If you have a substantial existing C/C++ library, particularly one that is undergoing continued development and needs to be used with both c/C++ and Python code: use SWIG (or maybe SIP, but I've never heard of that being used with numpy) If you have a single dll (or *.so, etc) or small lib, use ctypes. If you have ONLY the dll, and not source code, definitely use ctypes! If you're developing extensions just for use with Python, use pyrex or boost. Prefer pyrex is it's C, boost if it's C++. Boost gets even more compelling if you are using other boost libs for your C++ stuff. Cxx maybe worth a look-see. I think it's being used for matplotlib, so there must be a way to so numpy with it. http://sourceforge.net/projects/cxx/ It would be great it we could put a note like this, with more detail, on the Scipy Wiki. Maybe you could do that when you learn more. (oh, and be sure to check the Scipy Wiki. there is some stuff there already) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From ronaldoussoren at mac.com Tue Dec 12 10:44:26 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 12 Dec 2006 10:44:26 +0100 Subject: [Pythonmac-SIG] Catching exceptions inside python with catch_exception_raise() doesn't work In-Reply-To: <506DCEAC-1E98-4084-B378-58537E3A4148@securityevaluators.com> References: <506DCEAC-1E98-4084-B378-58537E3A4148@securityevaluators.com> Message-ID: <97B5399F-EF49-4E4E-B1C3-5ABC8622272A@mac.com> Hi, I haven't used the raw mach API's yet, so can't help you here. I must say that this looks like a pretty evil API. I wonder why they didn't use a manually passed in callback function like sane APIs. Ronald On Dec 11, 2006, at 11:43 PM, Charlie Miller wrote: > Is it possible to monitor for exceptions using the Mac OS X > catch_exception_raise function inside python? As you may know, after > some setup, this function gets called whenever an exception occurs. > I have a program which works great in C but when I wrap it in python > it fails. This is due to the fact that it calls exc_server, which > uses _dyld_lookup_and_bind, to try to find the location of the > function catch_exception_raise. When wrapped in python, > dyld_lookup_and_bind returns 0x2030 which is NOT the correct > address. It then jumps there and tries executing which causes a BUS > ERROR. > > In C at least, dyld_lookup_and_bind works if the > catch_exception_raise function is compiled into the binary or linked > dynamically at runtime via a shared library (dylib). However, it > doesn't work if it is brought into the executable space via dlopen - > which presumably is how python does it. > > How can I set it up so that I can monitor applications for exceptions > in a python script? I could fork and exec a program with its own > address space, but that seems ridiculous. I could recompile the > python interpreter and include catch_exception_raise, but that also > seems terrible. Or is it impossible to wrap such a program in python > - which seems silly? > > Any help is appreciated. Thanks, > > Charlie > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061212/7788113d/attachment.bin From ronaldoussoren at mac.com Tue Dec 12 11:11:58 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 12 Dec 2006 11:11:58 +0100 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: References: Message-ID: On Dec 11, 2006, at 9:20 PM, Russell E. Owen wrote: > I've been trying out ctypes (from MacPython 2.5) on MacOS X on a > PPC Mac > and have run into a problem. I hope I'm just doing something > stupid, but > it seems to match the tutorial so I'm really puzzled: I can reproduce this on an intel system as well. You might want to ask about this on the ctypes list (https://lists.sourceforge.net/ lists/listinfo/ctypes-users), maybe you're using ctypes incorrectly. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061212/2f94b70c/attachment.bin From Hubert.Holin at lmd.polytechnique.fr Tue Dec 12 11:02:12 2006 From: Hubert.Holin at lmd.polytechnique.fr (Hubert Holin) Date: Tue, 12 Dec 2006 11:02:12 +0100 Subject: [Pythonmac-SIG] cyptes problem on MacOS X In-Reply-To: References: Message-ID: <9748969D-8E22-4548-80B0-672B2186DC05@lmd.polytechnique.fr> Paris (U.E.), le 12/12/2006 Bonjour On Mon Dec 11 21:20:23 CET 2006, Russell E. Owen wrote: > Other suggestions are welcome. We'll mostly be interfacing to C++ so > I've considered trying out Boost, but it hasn't had an update in years > which worries me. Robustness, ease of use and speed are all major > requirements. Linux and MacOS X are the main platforms. Admittedly, the latest Boost release is taking longer than what we would have hoped (it is an overwhelmingly volunteer effort, and as far as I am concerned, I know I was far less available to help than I would have liked, so I can understand that others are in the same boat...), but I can assure you that Boost is alive and well, and last I heard the next release is indeed now at hand. As regards the Python bindings in particular, a lot has been done, as can be seen from messages on the c++-sig list. At any rate, it is always possible to join Boost and download the WIP library rather than the official release if there is a particular, urgent, need. Bon courage Hubert Holin From lou_boog2000 at yahoo.com Tue Dec 12 17:24:13 2006 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Tue, 12 Dec 2006 08:24:13 -0800 (PST) Subject: [Pythonmac-SIG] Best/Safest way to parse NumPy array in C extension? Message-ID: <579946.48484.qm@web34408.mail.mud.yahoo.com> I've done this two ways. Which is better or safer? Say I'm passing a NumPy array (float) to a C extension. One way to "parse" it is (ignoring checks on return values, etc. for now), PyArrayObject *mat; PyArg_ParseTuple(args, "O!", &PyArray_Type, &mat); or is this better, PyObject *Pymat; PyArrayObject *mat; PyArg_ParseTuple(args, "O", &Pymat); mat=PyArray_ContiguousFromObject(objin,NPY_DOUBLE, 2,2); The latter appears to have the constraint that the array be contiguous. Or is that an illusion and it's saying it _expects_ a Python object that has contiguous data? I've done both. Pointing C arrays to the resulting PyArrays' data works fine, but I fear one way or the other might be courting disaster. BTW, I do other checks on dimension, type, etc., but I left those out here for clarity. (I hope.) -- Lou Pecora My views are my own. ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com From lou_boog2000 at yahoo.com Tue Dec 12 17:28:31 2006 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Tue, 12 Dec 2006 08:28:31 -0800 (PST) Subject: [Pythonmac-SIG] [SciPy-user] Best/Safest way to parse NumPy array in C extension? In-Reply-To: <579946.48484.qm@web34408.mail.mud.yahoo.com> Message-ID: <117751.42356.qm@web34405.mail.mud.yahoo.com> YIKES. That one line should read mat=PyArray_ContiguousFromObject(Pymat,NPY_DOUBLE,2,2); Very sorry. --- Lou Pecora wrote: > I've done this two ways. Which is better or safer? > > Say I'm passing a NumPy array (float) to a C > extension. One way to "parse" it is (ignoring > checks > on return values, etc. for now), > > PyArrayObject *mat; > PyArg_ParseTuple(args, "O!", &PyArray_Type, &mat); > > or is this better, > > PyObject *Pymat; > PyArrayObject *mat; > PyArg_ParseTuple(args, "O", &Pymat); > mat=PyArray_ContiguousFromObject(objin,NPY_DOUBLE, > 2,2); > > The latter appears to have the constraint that the > array be contiguous. Or is that an illusion and > it's > saying it _expects_ a Python object that has > contiguous data? > > I've done both. Pointing C arrays to the resulting > PyArrays' data works fine, but I fear one way or the > other might be courting disaster. > > BTW, I do other checks on dimension, type, etc., but > I > left those out here for clarity. (I hope.) > > > > > > -- Lou Pecora > My views are my own. > > > > ____________________________________________________________________________________ > Do you Yahoo!? > Everyone is raving about the all-new Yahoo! Mail > beta. > http://new.mail.yahoo.com > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.org > http://projects.scipy.org/mailman/listinfo/scipy-user > -- Lou Pecora My views are my own. ____________________________________________________________________________________ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. From Chris.Barker at noaa.gov Tue Dec 12 18:33:17 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 12 Dec 2006 09:33:17 -0800 Subject: [Pythonmac-SIG] [SciPy-user] Best/Safest way to parse NumPy array in C extension? In-Reply-To: <117751.42356.qm@web34405.mail.mud.yahoo.com> References: <117751.42356.qm@web34405.mail.mud.yahoo.com> Message-ID: <457EE7DD.9050304@noaa.gov> Lou, This type of question is best posed on the numpy list: http://projects.scipy.org/mailman/listinfo/numpy-discussion Lou Pecora wrote: >> PyArrayObject *mat; >> PyArg_ParseTuple(args, "O!", &PyArray_Type, &mat); If you do this, you then need to check and see if the array that got passed in has the properties you want: size, shape, type. >> PyObject *Pymat; >> PyArrayObject *mat; >> PyArg_ParseTuple(args, "O", &Pymat); >> mat=PyArray_ContiguousFromObject(objin,NPY_DOUBLE, >> 2,2); I've always used PyArray_ContiguousFromObject, because then it does all the checking for me, and it allows my code to accept anything that can by turned into a numpy array. >> The latter appears to have the constraint that the >> array be contiguous. Or is that an illusion and >> it's >> saying it _expects_ a Python object that has >> contiguous data? What it does is convert whatever you pass in to a Contiguous array. If it already is a contiguous array, then it returns itself (I think -- check the docs). There is probably something like: PyArray_FromObject That does not guarantee contiguous, if you don't need that. By the way, I think these are the old Numeric names, which numpy has a compatibility layer for, but you may want to use the new, numpy ones. There are a lot, but most are special cases of: Py_Array_FromAny This is well documented in the Numpy book, I'm not sure about what's online. >> I've done both. Pointing C arrays to the resulting >> PyArrays' data works fine, but I fear one way or the >> other might be courting disaster. >> >> BTW, I do other checks on dimension, type, etc., but >> I left those out here for clarity. (I hope.) If you do all those checks, you're OK, but do make sure you are not assuming contiguous, if you haven't forced it -- that can slip through testing. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From lou_boog2000 at yahoo.com Tue Dec 12 18:53:07 2006 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Tue, 12 Dec 2006 09:53:07 -0800 (PST) Subject: [Pythonmac-SIG] [SciPy-user] Best/Safest way to parse NumPy array in C extension? In-Reply-To: <457EE7DD.9050304@noaa.gov> Message-ID: <20061212175307.96350.qmail@web34414.mail.mud.yahoo.com> Thanks for the answers, Chris. A few comments and questions beyond what I asked and you answered: --- Christopher Barker wrote: > Lou, > > This type of question is best posed on the numpy > list: > > http://projects.scipy.org/mailman/listinfo/numpy-discussion Ah, yet another mailing list to join. Sigh. :-) > Lou Pecora wrote: > > >> PyArrayObject *mat; > >> PyArg_ParseTuple(args, "O!", &PyArray_Type, > &mat); > > If you do this, you then need to check and see if > the array that got > passed in has the properties you want: size, shape, > type. I do, but I don't know how to check in Python for contiguous. I will search for that. Should be a way. > > >> PyObject *Pymat; > >> PyArrayObject *mat; > >> PyArg_ParseTuple(args, "O", &Pymat); > >> > mat=PyArray_ContiguousFromObject(objin,NPY_DOUBLE, > >> 2,2); > > I've always used PyArray_ContiguousFromObject, > because then it does all > the checking for me, and it allows my code to accept > anything that can > by turned into a numpy array. Got it. That's what I suspected. > >> The latter appears to have the constraint that > the > >> array be contiguous. Or is that an illusion and > >> it's > >> saying it _expects_ a Python object that has > >> contiguous data? > > What it does is convert whatever you pass in to a > Contiguous array. If > it already is a contiguous array, then it returns > itself (I think -- > check the docs). There is probably something like: > > PyArray_FromObject > > That does not guarantee contiguous, if you don't > need that. That can lead to a problem. If I have a C extension in which I expect to operate on the array data in place, then passing a non-contiguous array will cause a new data set to be developed (new memory, I would assume) and the original array would not be changed in place by my C operations. Then I have a problem. The original array is unchanged, but I assume it has been changed. In this case I would want a check on whether the input array is contiguous and an exception raised if not ... or something to say there's a data-structure problem. -- Lou Pecora My views are my own. ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited From delza at livingcode.org Wed Dec 13 01:28:22 2006 From: delza at livingcode.org (Dethe Elza) Date: Tue, 12 Dec 2006 16:28:22 -0800 Subject: [Pythonmac-SIG] py2app plugin problem: "Error loading code" In-Reply-To: <50193F5C-BDEF-4C33-BF27-E553CD76304C@mac.com> References: <0FE46EBB-032F-4157-BD8D-318EDB94A47F@alum.mit.edu> <7C1340EA-9112-4728-A693-E8BD9296574A@alum.mit.edu> <50193F5C-BDEF-4C33-BF27-E553CD76304C@mac.com> Message-ID: <98BD2CB2-3EC4-457C-8196-932F731D6063@livingcode.org> On 10-Dec-06, at 1:37 PM, Ronald Oussoren wrote: > The problem is that py2app/bundletemplate/prebuild/main in the > py2app distribution is an intel-only binary (at least in the > current trunk) instead of a universal binary. > > Removing the file and running 'setup.py' in the bundletemplate > directory should rebuild it with the proper architecture for your > machine. Ytrewq1 and I were working on this and he(?) came up with a solution that seems to work for universal binaries: On 10-Nov-2006 ytrewq1 wrote: > I think I got something working. > > The steps I followed were: > > 1. Move the prebuilt main binary out of the way > (py2app/bundletmplate/prebuilt/main) > 2. Modify py2app/bundletemplate/setup.py so that it builds > universal binaries > > In step 2, I changed the CFLAGS line to be: > > CFLAGS = '-Os -Wall -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch > i386 -arch ppc' > > That seemed to do it for me. This worked for me, but I had other issues, which turned out to be that when I'd installed Stackless it had taken over as my main python, and since it mostly worked, it took me awhile to see the obvious. So far using the above recipe is working well for me. --Dethe When laws are outlawed, only outlaws will have laws. From generalkernel at gmail.com Tue Dec 12 22:19:20 2006 From: generalkernel at gmail.com (Gen Kazama) Date: Tue, 12 Dec 2006 16:19:20 -0500 Subject: [Pythonmac-SIG] CPython on Mac OSX Message-ID: Hi I'm running python 2.3 on 10.4. i made an application using a C backend and a python frontend. This is a school project and although it works perfectly on the school computers, i have trouble compiling the C code correctly on the mac to make it into a python module (maybe this is because the school computers used python 2.4-ie, an updated version of Python.h). Anyway here is how I compile it at school: gcc -I /usr/include/python2.4 -c mandel.c gcc -shared mandel.o -o mandel.so which works with no flaws. then , I try compiling it on my mac: gcc -I /usr/include/python2.3 -c mandel.c gcc mandel.o -o mandel.so (note: -shared wasn't found on my mac for some reason). I get the following errors: /usr/bin/ld: Undefined symbols: _main _PyArg_ParseTuple _PyInt_FromLong _PyString_FromString _PyTuple_New _PyTuple_SetItem _Py_InitModule4 collect2: ld returned 1 exit status If anyone could tell me how to compile this C code into a python module on my mac, i would greatly appreciate it. thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061212/b36856da/attachment.htm From bob at redivi.com Thu Dec 14 11:28:29 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 14 Dec 2006 18:28:29 +0800 Subject: [Pythonmac-SIG] CPython on Mac OSX In-Reply-To: References: Message-ID: <6a36e7290612140228w72627897l988b7f647a881093@mail.gmail.com> On 12/13/06, Gen Kazama wrote: > Hi I'm running python 2.3 on 10.4. i made an application using a C backend > and a python frontend. > > This is a school project and although it works perfectly on the school > computers, i have trouble compiling the C code correctly on the mac to make > it into a python module (maybe this is because the school computers used > python 2.4-ie, an updated version of Python.h). > > Anyway here is how I compile it at school: > > gcc -I /usr/include/python2.4 -c mandel.c > gcc -shared mandel.o -o mandel.so > > which works with no flaws. then , I try compiling it on my mac: > > gcc -I /usr/include/python2.3 -c mandel.c > gcc mandel.o -o mandel.so > > (note: -shared wasn't found on my mac for some reason). I get the following > errors: > > /usr/bin/ld: Undefined symbols: > _main > _PyArg_ParseTuple > _PyInt_FromLong > _PyString_FromString > _PyTuple_New > _PyTuple_SetItem > _Py_InitModule4 > collect2: ld returned 1 exit status > > > If anyone could tell me how to compile this C code into a python module on > my mac, i would greatly appreciate it. thanks! The best way is to use distutils (or setuptools). Create a setup.py that compiles it for you. This works on every platform, even windows. -bob From ronaldoussoren at mac.com Thu Dec 14 11:31:17 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 14 Dec 2006 11:31:17 +0100 Subject: [Pythonmac-SIG] CPython on Mac OSX In-Reply-To: References: Message-ID: The best way to do this is using distutils, which is the standard python package for building and installing python packages. The document at should get you going. To quote from that, create a setup.py containing: #BEGIN OF FILE from distutils.core import setup, Extension module1 = Extension('demo', sources = ['mandel.c']) setup (name = 'MandelPackage', version = '1.0', description = 'This is a demo package', ext_modules = [module1]) #END OF FILE If you want to install the extension: 'python setup.py install'. This will install it into the site-packages directory. If you create a setup.cfg containing the text below you can use 'python setup.py build' to build the extension in the current directory # setup.cfg [build_ext] inplace = 1 # end setup.cfg Ronald On Dec 12, 2006, at 10:19 PM, Gen Kazama wrote: > Hi I'm running python 2.3 on 10.4. i made an application using a C > backend and a python frontend. > > This is a school project and although it works perfectly on the > school computers, i have trouble compiling the C code correctly on > the mac to make it into a python module (maybe this is because the > school computers used python 2.4-ie, an updated version of Python.h). > > Anyway here is how I compile it at school: > > gcc -I /usr/include/python2.4 -c mandel.c > gcc -shared mandel.o -o mandel.so > > which works with no flaws. then , I try compiling it on my mac: > > gcc -I /usr/include/python2.3 -c mandel.c > gcc mandel.o -o mandel.so > > (note: -shared wasn't found on my mac for some reason). I get the > following errors: > > /usr/bin/ld: Undefined symbols: > _main > _PyArg_ParseTuple > _PyInt_FromLong > _PyString_FromString > _PyTuple_New > _PyTuple_SetItem > _Py_InitModule4 > collect2: ld returned 1 exit status > > > If anyone could tell me how to compile this C code into a python > module on my mac, i would greatly appreciate it. thanks! > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061214/4b59889d/attachment.bin From dan at chalkie.org.uk Thu Dec 14 15:03:12 2006 From: dan at chalkie.org.uk (Dan White) Date: Thu, 14 Dec 2006 16:03:12 +0200 Subject: [Pythonmac-SIG] undefined symbols when making python wrapped c libs for itk In-Reply-To: References: Message-ID: Hi, Actually i see the same error message using python2.5 when building ITK python wrapping. I was wondering what i am doing wrong that ld is not seeing pytohn properly to find those symbols? Any one know what is going wrong to give error message like >> /usr/bin/ld: Undefined symbols: >> _main >> _PyArg_ParseTuple >> _PyInt_FromLong >> _PyString_FromString >> _PyTuple_New >> _PyTuple_SetItem >> _Py_InitModule4 >> collect2: ld returned 1 exit status which lib or headers or something is ld not seeing? cheers Dan On 14 Dec 2006, at 13:00, pythonmac-sig-request at python.org wrote: > From: "Bob Ippolito" > Date: 14 December 2006 12:28:29 GMT+02:00 > To: "Gen Kazama" > Cc: pythonmac-sig at python.org > Subject: Re: [Pythonmac-SIG] CPython on Mac OSX > > > On 12/13/06, Gen Kazama wrote: >> Hi I'm running python 2.3 on 10.4. i made an application using a >> C backend >> and a python frontend. >> >> This is a school project and although it works perfectly on the >> school >> computers, i have trouble compiling the C code correctly on the >> mac to make >> it into a python module (maybe this is because the school >> computers used >> python 2.4-ie, an updated version of Python.h). >> >> Anyway here is how I compile it at school: >> >> gcc -I /usr/include/python2.4 -c mandel.c >> gcc -shared mandel.o -o mandel.so >> >> which works with no flaws. then , I try compiling it on my mac: >> >> gcc -I /usr/include/python2.3 -c mandel.c >> gcc mandel.o -o mandel.so >> >> (note: -shared wasn't found on my mac for some reason). I get the >> following >> errors: >> >> /usr/bin/ld: Undefined symbols: >> _main >> _PyArg_ParseTuple >> _PyInt_FromLong >> _PyString_FromString >> _PyTuple_New >> _PyTuple_SetItem >> _Py_InitModule4 >> collect2: ld returned 1 exit status >> >> >> If anyone could tell me how to compile this C code into a python >> module on >> my mac, i would greatly appreciate it. thanks! > > The best way is to use distutils (or setuptools). Create a setup.py > that compiles it for you. This works on every platform, even windows. > > -bob Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyv?skyl? Jyv?skyl? FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk dan at chalkie.org.uk white at cc.jyu.fi From bob at redivi.com Thu Dec 14 18:20:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 15 Dec 2006 01:20:22 +0800 Subject: [Pythonmac-SIG] undefined symbols when making python wrapped c libs for itk In-Reply-To: References: Message-ID: <6a36e7290612140920h751020b5pfe96b0c4154ebc90@mail.gmail.com> The correct way to link Python extensions is to use distutils, end of story. The compiler/linker flags are different for every platform and sometimes differ based upon the way it's built. Specifically in this case all that should be necessary is -undefined dynamic_lookup -- however, the only good fix is to use distutils. -bob On 12/14/06, Dan White wrote: > Hi, > > Actually i see the same error message using python2.5 when building > ITK python wrapping. > > I was wondering what i am doing wrong that ld is not seeing pytohn > properly to find those symbols? > > Any one know what is going wrong to give error message like > > >> /usr/bin/ld: Undefined symbols: > >> _main > >> _PyArg_ParseTuple > >> _PyInt_FromLong > >> _PyString_FromString > >> _PyTuple_New > >> _PyTuple_SetItem > >> _Py_InitModule4 > >> collect2: ld returned 1 exit status > > which lib or headers or something is ld not seeing? > > cheers > > Dan > > > On 14 Dec 2006, at 13:00, pythonmac-sig-request at python.org wrote: > > > From: "Bob Ippolito" > > Date: 14 December 2006 12:28:29 GMT+02:00 > > To: "Gen Kazama" > > Cc: pythonmac-sig at python.org > > Subject: Re: [Pythonmac-SIG] CPython on Mac OSX > > > > > > On 12/13/06, Gen Kazama wrote: > >> Hi I'm running python 2.3 on 10.4. i made an application using a > >> C backend > >> and a python frontend. > >> > >> This is a school project and although it works perfectly on the > >> school > >> computers, i have trouble compiling the C code correctly on the > >> mac to make > >> it into a python module (maybe this is because the school > >> computers used > >> python 2.4-ie, an updated version of Python.h). > >> > >> Anyway here is how I compile it at school: > >> > >> gcc -I /usr/include/python2.4 -c mandel.c > >> gcc -shared mandel.o -o mandel.so > >> > >> which works with no flaws. then , I try compiling it on my mac: > >> > >> gcc -I /usr/include/python2.3 -c mandel.c > >> gcc mandel.o -o mandel.so > >> > >> (note: -shared wasn't found on my mac for some reason). I get the > >> following > >> errors: > >> > >> /usr/bin/ld: Undefined symbols: > >> _main > >> _PyArg_ParseTuple > >> _PyInt_FromLong > >> _PyString_FromString > >> _PyTuple_New > >> _PyTuple_SetItem > >> _Py_InitModule4 > >> collect2: ld returned 1 exit status > >> > >> > >> If anyone could tell me how to compile this C code into a python > >> module on > >> my mac, i would greatly appreciate it. thanks! > > > > The best way is to use distutils (or setuptools). Create a setup.py > > that compiles it for you. This works on every platform, even windows. > > > > -bob > > Dr. Daniel James White BSc. (Hons.) PhD > Bioimaging Coordinator > Nanoscience Centre and Department of Biological and Environmental > Sciences > Division of Molecular Recognition > Ambiotica C242 > PO Box 35 > University of Jyv?skyl? > Jyv?skyl? > FIN 40014 > Finland > > +358 14 260 4183 (work) > +358 468102840 (mobile) > http://www.bioimagexd.org > http://www.chalkie.org.uk > dan at chalkie.org.uk > white at cc.jyu.fi > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From josh.p.marshall at gmail.com Fri Dec 15 04:49:06 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Fri, 15 Dec 2006 14:49:06 +1100 Subject: [Pythonmac-SIG] Universal binary SciPy on OS X Message-ID: <3539EE2B-72B8-4BF7-8431-A3F8AE8302E2@gmail.com> I have been trying to build a universal SciPy that works, so I can include it in a redistributable application I build with py2app. The one at http://pythonmac.org/packages/py24-fat/index.html is *incomplete*, it contains some dynamic libraries which are ppc only, which is what also happens when I try to build a universal binary myself.Some libs build fine, but some are only a single arch (the native one). The results of for FILE in `find . | grep '\.so'` ; do lipo -info $FILE ; done are: ------------------------------------------------------------------------ ----------- Architectures in the fat file: ./scipy/cluster/_vq.so are: i386 ppc Non-fat file: ./scipy/fftpack/_fftpack.so is architecture: ppc Non-fat file: ./scipy/fftpack/convolve.so is architecture: ppc Non-fat file: ./scipy/integrate/_odepack.so is architecture: ppc Non-fat file: ./scipy/integrate/_quadpack.so is architecture: ppc Non-fat file: ./scipy/integrate/vode.so is architecture: ppc Non-fat file: ./scipy/interpolate/_fitpack.so is architecture: ppc Non-fat file: ./scipy/interpolate/dfitpack.so is architecture: ppc Architectures in the fat file: ./scipy/io/numpyio.so are: i386 ppc Architectures in the fat file: ./scipy/lib/blas/cblas.so are: i386 ppc Non-fat file: ./scipy/lib/blas/fblas.so is architecture: ppc Architectures in the fat file: ./scipy/lib/lapack/atlas_version.so are: i386 ppc Non-fat file: ./scipy/lib/lapack/calc_lwork.so is architecture: ppc Architectures in the fat file: ./scipy/lib/lapack/clapack.so are: i386 ppc Architectures in the fat file: ./scipy/lib/lapack/flapack.so are: i386 ppc Non-fat file: ./scipy/linalg/_flinalg.so is architecture: ppc Non-fat file: ./scipy/linalg/_iterative.so is architecture: ppc Architectures in the fat file: ./scipy/linalg/atlas_version.so are: i386 ppc Non-fat file: ./scipy/linalg/calc_lwork.so is architecture: ppc Architectures in the fat file: ./scipy/linalg/cblas.so are: i386 ppc Architectures in the fat file: ./scipy/linalg/clapack.so are: i386 ppc Non-fat file: ./scipy/linalg/fblas.so is architecture: ppc Non-fat file: ./scipy/linalg/flapack.so is architecture: ppc Architectures in the fat file: ./scipy/linsolve/_csuperlu.so are: i386 ppc Architectures in the fat file: ./scipy/linsolve/_dsuperlu.so are: i386 ppc Architectures in the fat file: ./scipy/linsolve/_ssuperlu.so are: i386 ppc Architectures in the fat file: ./scipy/linsolve/_zsuperlu.so are: i386 ppc Architectures in the fat file: ./scipy/ndimage/_nd_image.so are: i386 ppc Non-fat file: ./scipy/odr/__odrpack.so is architecture: ppc Non-fat file: ./scipy/optimize/_cobyla.so is architecture: ppc Non-fat file: ./scipy/optimize/_lbfgsb.so is architecture: ppc Non-fat file: ./scipy/optimize/_minpack.so is architecture: ppc Architectures in the fat file: ./scipy/optimize/_zeros.so are: i386 ppc Non-fat file: ./scipy/optimize/minpack2.so is architecture: ppc Architectures in the fat file: ./scipy/optimize/moduleTNC.so are: i386 ppc Architectures in the fat file: ./scipy/signal/sigtools.so are: i386 ppc Architectures in the fat file: ./scipy/signal/spline.so are: i386 ppc Non-fat file: ./scipy/sparse/sparsetools.so is architecture: ppc Non-fat file: ./scipy/special/_cephes.so is architecture: ppc Non-fat file: ./scipy/special/specfun.so is architecture: ppc Non-fat file: ./scipy/stats/futil.so is architecture: ppc Non-fat file: ./scipy/stats/mvn.so is architecture: ppc Non-fat file: ./scipy/stats/statlib.so is architecture: ppc Architectures in the fat file: ./scipy/stsci/convolve/_correlate.so are: i386 ppc Architectures in the fat file: ./scipy/stsci/image/_combine.so are: i386 ppc ------------------------------------------------------------------------ ----------- So I didn't pursue this any further for the time being. Since I am not an expert on the SciPy build process, I'm trying to work around this. Instead I took your (Chris') versions from http://trichech.us/? page_id=4 , both ppc and intel SuperPacks. I yanked the scipy dirs out of the packages, and called them scipy-ppc and scipy-i386. Then what I did was lipo the shared libs together, as described on Apple's site: http://developer.apple.com/opensource/buildingopensourceuniversal.html Like so: mv scipy-ppc scipy-universal cd scipy-universal for FILE in `find . | grep '\.so'` ; do file $FILE ; done # shows all ppc libs for LIB in `find . | grep '\.so'` ; do lipo -create $LIB ../scipy- i386/$LIB -output $LIB ; done for FILE in `find . | grep '\.so'` ; do file $FILE ; done # shows all universal libs, yay! cd .. sudo cp -r scipy-universal $PYTHON_SITEPACKAGES/scipy Now this works fine on my G4. I won't have a chance to test on an Intel Mac until later in the week, but this looks promising. Chris, since the package seem to be identical apart from the shared libs, you could probably do this on the SuperPack and only need to distribute one version. Could I also have some advice on how to deal with this sort of stuff. I imagine that much of it is tied up with not having an Apple-blessed Fortran compiler. (Fingers crossed for Leopard). Thanks for all your help everyone, Josh From vivacarlie at gmail.com Sat Dec 16 23:18:47 2006 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Sat, 16 Dec 2006 16:18:47 -0600 Subject: [Pythonmac-SIG] About Obj-C 2.0 language bridge Message-ID: <65fadfc30612161418q11fe1572l5376cb791fa55217@mail.gmail.com> I just wanted to bring the attention to the community that there will be a python/Objective C language bridge implemented come the release of Leopard, Mac OS 10.5 . These are a few questions I wanted to ask the MacPython Dev team I was wondering how are we going to tailor the MacPython programming environment for those who want to use the bridge in programming for python? Will Py2App take advantage of this new ability and if so, how? How does this contrast with using PyObjC? -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061216/e7271873/attachment.html From ronaldoussoren at mac.com Sun Dec 17 11:17:55 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 17 Dec 2006 02:17:55 -0800 Subject: [Pythonmac-SIG] About Obj-C 2.0 language bridge In-Reply-To: <65fadfc30612161418q11fe1572l5376cb791fa55217@mail.gmail.com> References: <65fadfc30612161418q11fe1572l5376cb791fa55217@mail.gmail.com> Message-ID: <32B7418C-010F-1000-BA3F-2BA499D39836-Webmail-10009@mac.com> On Saturday, December 16, 2006, at 11:19PM, "Nehemiah Dacres" wrote: >I just wanted to bring the attention to the community that there will >be a python/Objective >C >language bridge implemented come the >release of Leopard, Mac OS >10.5 >. >These are a few questions I wanted to ask the MacPython Dev team >I was wondering how are we going to tailor the MacPython programming >environment for those who want to use the bridge in programming for python? >Will Py2App take advantage of this new ability and if so, how? >How does this contrast with using PyObjC? As Leopard is still under NDA please don't expect answers with any kind of substance. Ronald From jrus at hcs.harvard.edu Mon Dec 18 20:06:10 2006 From: jrus at hcs.harvard.edu (Jacob Rus) Date: Mon, 18 Dec 2006 14:06:10 -0500 Subject: [Pythonmac-SIG] About Obj-C 2.0 language bridge In-Reply-To: <65fadfc30612161418q11fe1572l5376cb791fa55217@mail.gmail.com> References: <65fadfc30612161418q11fe1572l5376cb791fa55217@mail.gmail.com> Message-ID: Nehemiah Dacres wrote: > I just wanted to bring the attention to the community that there will > be a python/Objective C language bridge implemented come the > release of Leopard, Mac OS 10.5 > > These are a few questions I wanted to ask the MacPython Dev team > I was wondering how are we going to tailor the MacPython programming > environment for those who want to use the bridge in programming for python? > Will Py2App take advantage of this new ability and if so, how? > How does this contrast with using PyObjC? I don't actually have any inside knowledge (I don't have access to Leopard developer builds, etc.), but I rather doubt that Apple is completely re-implementing PyObjC. At least a few of the people who work on PyObjC are Apple employees, and there was a tutorial showing how to make a Cocoa app using PyObjC at apple.com a few months ago. It was my impression that the Cocoa-python bridge discussed in the leopard preview docs *is* PyObjC, though of course I could be way off the mark, etc. -Jacob From hamish at gmail.com Tue Dec 19 00:11:27 2006 From: hamish at gmail.com (Hamish Allan) Date: Mon, 18 Dec 2006 23:11:27 +0000 Subject: [Pythonmac-SIG] How to fathom appscript Message-ID: <597e7edb0612181511n689164f6o3bb6f462f21536a4@mail.gmail.com> Hi, I'm new to appscript (and relatively new to python) and I'm having trouble fathoming out how to determine what can be done with each type of object. For example, itunes = app('iTunes') x = itunes.sources.first.playlists[its.name.contains('MyName')] This code fetches any playlists containing the string 'MyName'. But I want an exact match. Using 'equals' rather than 'contains' doesn't work. How do I find out which operations its.name supports? And more generally, what is possible in other similar situations with different objects? I also want to do what the following code suggests: x = itunes.sources.first.playlist_folders[its.name.equals('MyFolder')] y = itunes.sources.first.playlists[its.parent.equals(x)] Is this possible? Many thanks, Hamish From njriley at uiuc.edu Tue Dec 19 01:20:54 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Mon, 18 Dec 2006 18:20:54 -0600 Subject: [Pythonmac-SIG] How to fathom appscript In-Reply-To: <597e7edb0612181511n689164f6o3bb6f462f21536a4@mail.gmail.com> References: <597e7edb0612181511n689164f6o3bb6f462f21536a4@mail.gmail.com> Message-ID: <20061219002054.GA64589@uiuc.edu> On Mon, Dec 18, 2006 at 11:11:27PM +0000, Hamish Allan wrote: > itunes = app('iTunes') > x = itunes.sources.first.playlists[its.name.contains('MyName')] > > This code fetches any playlists containing the string 'MyName'. But I > want an exact match. Using 'equals' rather than 'contains' doesn't > work. You just use '==' instead. In [4]: itunes.sources.first.playlists[its.name == 'Stations']() Out[4]: [app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(1936)] But in this case, you don't need to. In [6]: itunes.sources.first.playlists['Stations']() Out[6]: app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(1936) Most objects support multiple reference forms, as you'll see if you look at their documentation. > How do I find out which operations its.name supports? And more > generally, what is possible in other similar situations with different > objects? Use .help(). So, for example, you can see that the playlists can be referenced by index, name or ID: In [7]: itunes.sources.first.playlists.help() ============================================================================== Appscript Help (-t) Reference: app(u'/Applications/iTunes.app').sources.first.playlists ------------------------------------------------------------------------------ Description of reference Element: playlists -- by index, name, id [...] Note the reference forms above. It also helps to view the scripting dictionary, either using appscript's tools for doing so in a Web browser, or just with Script Editor (as I normally do). > I also want to do what the following code suggests: > > x = itunes.sources.first.playlist_folders[its.name.equals('MyFolder')] You want 'folder_playlists' not 'playlist_folders'. So again it's pretty simple: In [15]: itunes.sources.first.folder_playlists['Statistics']() Out[15]: app(u'/Applications/iTunes.app').sources.ID(41).folder_playlists.ID(122340) > y = itunes.sources.first.playlists[its.parent.equals(x)] Unfortunately here you run into a problem, as Apple didn't fully implement terminology for 'folder playlists', but you can view the scripting dictionary to figure it out. 'parent', while a property of playlists, isn't always set. So the only thing I could figure out was to iterate through them in Python: In [45]: stats_id = itunes.folder_playlists['Statistics'].id() In [46]: [p for p in itunes.user_playlists() if p.parent.exists() ....: and p.parent.id() == stats_id] Out[46]: [app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(1032), app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(1158), app(u'/Applications/iTunes.app').sources.ID(41).user_playlists.ID(1060)] -- Nicholas Riley | From mithro at mithis.com Sat Dec 23 11:00:55 2006 From: mithro at mithis.com (Tim Ansell) Date: Sat, 23 Dec 2006 20:30:55 +1030 Subject: [Pythonmac-SIG] Python and Zeroconf? Message-ID: <1166868056.6695.3.camel@localhost> Hello, My game is using ZeroConf to find local game servers. Under Linux I can use avahi or pyZeroConf to locate the servers (depending if avahi is installed or not). However as Mac OS X has it's own mDNS server I can't use either of these options. Is there a way to interface with the Mac's Zeroconf (Bonjour)? I have found http://www-unix.mcs.anl.gov/fl/research/accessgrid/bonjour-py/bonjour-py.html however there doesn't seem to be Universal Python binaries which I need to build binary packages. Anyway have any ideas? Thanks for your time. Tim Ansell From bob at redivi.com Sat Dec 23 13:29:36 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 23 Dec 2006 20:29:36 +0800 Subject: [Pythonmac-SIG] Python and Zeroconf? In-Reply-To: <1166868056.6695.3.camel@localhost> References: <1166868056.6695.3.camel@localhost> Message-ID: <6a36e7290612230429g11333c3cx384882cf133c072@mail.gmail.com> On 12/23/06, Tim Ansell wrote: > Hello, > > My game is using ZeroConf to find local game servers. Under Linux I can > use avahi or pyZeroConf to locate the servers (depending if avahi is > installed or not). > > However as Mac OS X has it's own mDNS server I can't use either of these > options. Is there a way to interface with the Mac's Zeroconf (Bonjour)? > > I have found > http://www-unix.mcs.anl.gov/fl/research/accessgrid/bonjour-py/bonjour-py.html however there doesn't seem to be Universal Python binaries which I need to build binary packages. Looks like source code. Compiles here. What's the problem? -bob From vivacarlie at gmail.com Tue Dec 26 19:29:12 2006 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Tue, 26 Dec 2006 12:29:12 -0600 Subject: [Pythonmac-SIG] Python and Zeroconf? In-Reply-To: <6a36e7290612230429g11333c3cx384882cf133c072@mail.gmail.com> References: <1166868056.6695.3.camel@localhost> <6a36e7290612230429g11333c3cx384882cf133c072@mail.gmail.com> Message-ID: <65fadfc30612261029s28f37b33yb0c69629926c1040@mail.gmail.com> his problem might be how to make fatpython byte code, or rather, universal binaries with python. On 12/23/06, Bob Ippolito wrote: > > On 12/23/06, Tim Ansell wrote: > > Hello, > > > > My game is using ZeroConf to find local game servers. Under Linux I can > > use avahi or pyZeroConf to locate the servers (depending if avahi is > > installed or not). > > > > However as Mac OS X has it's own mDNS server I can't use either of these > > options. Is there a way to interface with the Mac's Zeroconf (Bonjour)? > > > > I have found > > > http://www-unix.mcs.anl.gov/fl/research/accessgrid/bonjour-py/bonjour-py.htmlhowever there doesn't seem to be Universal Python binaries which I need to > build binary packages. > > Looks like source code. Compiles here. What's the problem? > > -bob > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061226/d33b69ce/attachment.html From Jack.Jansen at cwi.nl Wed Dec 27 00:23:54 2006 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed, 27 Dec 2006 00:23:54 +0100 Subject: [Pythonmac-SIG] Python and Zeroconf? In-Reply-To: <65fadfc30612261029s28f37b33yb0c69629926c1040@mail.gmail.com> References: <1166868056.6695.3.camel@localhost> <6a36e7290612230429g11333c3cx384882cf133c072@mail.gmail.com> <65fadfc30612261029s28f37b33yb0c69629926c1040@mail.gmail.com> Message-ID: On 26-Dec-2006, at 19:29 , Nehemiah Dacres wrote: > his problem might be how to make fat python byte code, or rather, > universal binaries with python. Python byte code is architecture-independent[*], so that shouldn't be a problem. [*] I think there was a problem with portability between machines with 32 and 64 bit integers, but I recall that that has been solved also. And at least it isn't a problem for ppc/intel mac portability. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061227/c468255c/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2255 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061227/c468255c/attachment.bin From uche at ogbuji.net Fri Dec 29 20:23:26 2006 From: uche at ogbuji.net (Uche Ogbuji) Date: Fri, 29 Dec 2006 12:23:26 -0700 Subject: [Pythonmac-SIG] Hello, and Wiki vandalism Message-ID: <45956B2E.6070108@ogbuji.net> Hi all, I just switched to a MacBook Pro for my primary dev box, so I guess I'll be hanging out here. I was trying to get started and went to the WIki, the FAQ in particular http://pythonmac.org/wiki/FAQ The page was spammed/vandalized on the 18th. I checked recent changes and a lot of pages got this treatment in mid-December,. I'm surprised they haven't been fixed, considering the importance of these pages. I know it's probably just a lack of volunteer time but I also know MoinMoin has some serviceable anti-spam features. I tried to fix the FAQ page myself reverting to the pre-spam version, but there seems to be some bug where preview shows the fixed version, but when I submit, it seems to be re-submitting the spam version. Really strange. Leaves me wondering what's the status of admin on the wiki. Thanks, and happy hols, all. -- Uche Ogbuji Work: The Kadomo Group, Inc. http://uche.ogbuji.net http://kadomo.com http://copia.ogbuji.net Lead dev at http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ From skip at pobox.com Fri Dec 29 20:49:25 2006 From: skip at pobox.com (skip at pobox.com) Date: Fri, 29 Dec 2006 13:49:25 -0600 Subject: [Pythonmac-SIG] Hello, and Wiki vandalism In-Reply-To: <45956B2E.6070108@ogbuji.net> References: <45956B2E.6070108@ogbuji.net> Message-ID: <17813.28997.621882.197196@montanaro.dyndns.org> Uche> http://pythonmac.org/wiki/FAQ Uche> The page was spammed/vandalized on the 18th. I checked recent Uche> changes and a lot of pages got this treatment in mid-December,. Uche> I'm surprised they haven't been fixed, considering the importance Uche> of these pages. I know it's probably just a lack of volunteer Uche> time but I also know MoinMoin has some serviceable anti-spam Uche> features. I tried to fix the FAQ page myself reverting to the Uche> pre-spam version, but there seems to be some bug where preview Uche> shows the fixed version, but when I submit, it seems to be Uche> re-submitting the spam version. Really strange. Leaves me Uche> wondering what's the status of admin on the wiki. I just set up a login. I don't even get a revert link with I click the info link. Skip From bob at redivi.com Sat Dec 30 04:35:26 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 29 Dec 2006 19:35:26 -0800 Subject: [Pythonmac-SIG] Hello, and Wiki vandalism In-Reply-To: <45956B2E.6070108@ogbuji.net> References: <45956B2E.6070108@ogbuji.net> Message-ID: <6a36e7290612291935g3f69e804w19b32b121c3dd372@mail.gmail.com> On 12/29/06, Uche Ogbuji wrote: > Hi all, > > I just switched to a MacBook Pro for my primary dev box, so I guess I'll > be hanging out here. I was trying to get started and went to the WIki, > the FAQ in particular > > http://pythonmac.org/wiki/FAQ > > The page was spammed/vandalized on the 18th. I checked recent changes > and a lot of pages got this treatment in mid-December,. I'm surprised > they haven't been fixed, considering the importance of these pages. I > know it's probably just a lack of volunteer time but I also know > MoinMoin has some serviceable anti-spam features. I tried to fix the > FAQ page myself reverting to the pre-spam version, but there seems to be > some bug where preview shows the fixed version, but when I submit, it > seems to be re-submitting the spam version. Really strange. Leaves me > wondering what's the status of admin on the wiki. > > Thanks, and happy hols, all. > The version of MoinMoin that's running on doesn't have anti-spam features. It's OLD. If someone with MoinMoin experience wants to take over managing the wiki I'd be all for that, but I can't set that up until after Jan 3. I've been away from the country all month (and am still away), and in general I don't have much time for the wiki. I definitely can't do anything about it until next year because I'm in Shanghai and the earthquake in Taipei basically took out the route between China and the US (~80% packet loss). The ISPs out here aren't smart enough or just don't want to pay extra peering costs so it doesn't seem like they're going to route around the problems. The undersea cables won't be fixed for weeks. On top of all that my MacBook Pro's power supply melted and they charge nearly twice what it costs in the US for one out here (infinitely more considering a replacement would be free at home), so it's hard to get at my SSH keys right now... even if I could make a working TCP connection to the states (if only Google had a proxy). -bob From uche at ogbuji.net Sun Dec 31 01:21:20 2006 From: uche at ogbuji.net (Uche Ogbuji) Date: Sat, 30 Dec 2006 17:21:20 -0700 Subject: [Pythonmac-SIG] Hello, and Wiki vandalism In-Reply-To: <6a36e7290612291935g3f69e804w19b32b121c3dd372@mail.gmail.com> References: <45956B2E.6070108@ogbuji.net> <6a36e7290612291935g3f69e804w19b32b121c3dd372@mail.gmail.com> Message-ID: <45970280.50107@ogbuji.net> Bob Ippolito wrote: > On 12/29/06, Uche Ogbuji wrote: >> Hi all, >> >> I just switched to a MacBook Pro for my primary dev box, so I guess I'll >> be hanging out here. I was trying to get started and went to the WIki, >> the FAQ in particular >> >> http://pythonmac.org/wiki/FAQ >> >> The page was spammed/vandalized on the 18th. I checked recent changes >> and a lot of pages got this treatment in mid-December,. I'm surprised >> they haven't been fixed, considering the importance of these pages. I >> know it's probably just a lack of volunteer time but I also know >> MoinMoin has some serviceable anti-spam features. I tried to fix the >> FAQ page myself reverting to the pre-spam version, but there seems to be >> some bug where preview shows the fixed version, but when I submit, it >> seems to be re-submitting the spam version. Really strange. Leaves me >> wondering what's the status of admin on the wiki. >> >> Thanks, and happy hols, all. >> > > The version of MoinMoin that's running on doesn't have anti-spam > features. It's OLD. If someone with MoinMoin experience wants to take > over managing the wiki I'd be all for that, but I can't set that up > until after Jan 3. > > I've been away from the country all month (and am still away), and in > general I don't have much time for the wiki. I definitely can't do > anything about it until next year because I'm in Shanghai and the > earthquake in Taipei basically took out the route between China and > the US (~80% packet loss). The ISPs out here aren't smart enough or > just don't want to pay extra peering costs so it doesn't seem like > they're going to route around the problems. The undersea cables won't > be fixed for weeks. > > On top of all that my MacBook Pro's power supply melted and they > charge nearly twice what it costs in the US for one out here > (infinitely more considering a replacement would be free at home), so > it's hard to get at my SSH keys right now... even if I could make a > working TCP connection to the states (if only Google had a proxy). Ouch. Sorry to hear of all those problems (I had heard of the undersea cable damage issue). I really have no cycles available to admin the Wiki, but I hope someone is able to step forward. I tried to do my little part by at least documenting what I learned and what worked for me: http://copia.ogbuji.net/blog/2006-12-30/First_day_ -- Uche Ogbuji Work: The Kadomo Group, Inc. http://uche.ogbuji.net http://kadomo.com http://copia.ogbuji.net Lead dev at http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ From skip at pobox.com Sun Dec 31 06:58:56 2006 From: skip at pobox.com (skip at pobox.com) Date: Sat, 30 Dec 2006 23:58:56 -0600 Subject: [Pythonmac-SIG] So what can we do to clean up the wiki? Message-ID: <17815.20896.33046.900341@montanaro.dyndns.org> I realize Bob's kind of hamstrung at the moment. I set up my login to the wiki to monitor all changes. I went through and fixed what I could. Without revert or DeletePage actions it's a bit tough. In addition, when I went to restore the FAQ and DrawBot content it told me "too many links" and wouldn't let me replace the crap with the correct content! I had to do them in several edits... If someone knows how to delete pages in that old version of Moin (SystemInfo barfs with a MemoryError, so I can't tell how old it is), please search for "junk" or "spam" in the text of all pages. Many of the pages that are returned should just be deleted. Skip