It seems there are some problems running Drpython on Mac OSX...
When I launch drpython.pyw, python opens the drpython menubar and then crashes, restarting the shell.
I don't know if it is a font problem as reported in other messages.
And in that case, what should I do and where ?
Could anybody help ?
I successfully installed drpython on my pc and am really willing to use it as well on my office mac.
That's a nice software...
Thanks in advance
My config is:
- Mac OS X 10.4.8 with PPC G5 1,8Ghz,
- Python 2.5
- wxpython 18.104.22.168 MAC Unicode py 2.5
It seems the thread 0 crashed. Below is an excerpt of the crash report:
Date/Time: 2007-05-21 09:52:38.530 +0200
OS Version: 10.4.8 (Build 8L127)
Report Version: 4
Parent: Python 
Version: 2.5a0 (2.5alpha0)
Exception: EXC_SOFTWARE (0x0005)
Thread 0 Crashed:
0 libwx_macud-2.8.0.dylib 0x02738ab8 wxFontRefData::MacFindFont() + 744 (icplusplus.c:28)
1 libwx_macud-2.8.0.dylib 0x02738e14 wxFont::RealizeResource() + 20 (icplusplus.c:28)
2 libwx_macud-2.8.0.dylib 0x0273a0f0 wxFont::SetFaceName(wxString const&) + 64 (icplusplus.c:28)
3 _gdi_.so 0x031c6e50 _wrap_Font_SetFaceName + 608 (_gdi_wrap.cpp:14931)
I cannot say anything here. I have no mac. Maybe some other people. Did you try asking
in the wxPython-mailing list. Should I ask? Well, I do!
Do you have a python traceback when starting with "python drpython.py".
PS: Thank you for your opinion of nice software! :)
Can you display the facename, used in SetFaceName? Is it installed on your system?
1/ No I have not asked the wxPython mailing list.
I went here first.
2/ The only message I receive when I launch "Terminal" is "Trace/BPT trap".
3/ It is really a very good software.
4/ Where should I search facename and SetFaceName ? In a drpython file ?
5/ I learnt python and wxpython alone (I am not a brand newbbie but not a good programmer either...) , so forgive the 4/ question ...
Thanks for your help
I have a Intel Mac with OS X 10.4.8, I have drPython running, but I will download the latest release from the cvs and install it to see if I get any trouble.
Make sure you start from a fresh system by deleting the preferences file, right now I do not remeber where is located, but if you search in this list for the post I have set you will find out this, otherwise wait until I get this done.
Remove the directory .drpython located on ~/Library/Preferences
in my case this is /Users/heberto/Library/Preferences/.drpython
BTW I have according to the changelog.txt release 166 and i works properly
is there any lineinfo/python file in the traceback.
In the sourcecode I found only 2 locations:
in drTreeDialog: w.SetFaceName(yarrr)
before it, could you try print yarrr?
an in drSourceBrowser:
maybe Antonio knows better, he answered the thread some weeks ago.
The wxPyhton Demo is running(?).
Do you have already a preferences.dat?
What is the value of:
(it is my entry on Windows)
in drPreferences.py, there are the default settings:
if defaultfont0 not in FontList:
if defaultfont1 not in FontList:
Could you print out/try another font?
Sorry for helping not much, I hope someone will answer in the wxPy mailing list.
The first thing I'd recommend you try is upgrading both your Python and wxPython releases. I don't have Python 2.5 myself, but I noticed it says "alpha" in the Python version number, so I suspect that was one of the initial Python 2.5 releases for Mac.
On wxPython 22.214.171.124 on Python 2.4, when I run DrPython I don't get any errors, but I do get a bunch of debug warnings because DrPython is trying to set the font to faces/configurations that don't exist on the OS X system I'm running it on. The offending font names seem to be "Courier 10 Pitch", "Sans" and "Sans Serif". Also, the latter two seem very odd to me as those aren't really face names, they're font families - specifically, the wxFONTFAMILY_ROMAN and wxFONTFAMILY_SWISS families.
Anyway, please let me know if it is still crashing for you with wxPython 126.96.36.199 and the latest Python 2.5. If so, I'll make a note of it on the wxPython lists and hopefully someone setup for 2.5 can take a look at it.
"Sans" and "Sans Serif" are typical aliases that are used on Linux systems, and the user can have whatever are their favorite fonts aliased to these names. They are not real font face names, but this is a common trap that Linux programmers fall into. IMO the best thing to do for any wx app to do is to default only to font families and not hard code any face names at all if possible. Then let the user choose which fonts to use and save those face names in a config file. Even then it's still a good idea to verify the names saved in the config file with the wx.FontEnumerator.
Hello Robin and Kevin, thank you very much for your recommendation and analysis, and also for taking your time, answering here directly! :)
Your suggestions are very helpful.
I (or any other DrPython fellow) will try to make a clean solution for that.
@Herberto and/or Dominique:
You are invited to submit a patch for that, if you want
and the problem is solved! :)
I uninstalled wxpython 188.8.131.52 and installed the latest version ie 184.108.40.206.
Guess what happened...
It works fine.
Thank you all for your help and your time spent for me.
May I advise the persons in charge of DrPython to put it clear (on the web site and / or in the ReadMe) that in case it doesn't work, the first thing to try is to re-install wxpython with the latest version.
Anyway, thank you so much.
It is really a great pleasure to have people trying to help (this apply of course also to wxPython users'list).
Great! You're welcome.
I added it to the notes.txt.
Thank you for not giving up! ;)
Hem Hem Hem...
Well I thought it worked...
Once drpython runs, when I try to run any application, the shell prints execvp failed with erro 2.
Below is the shell print:
"Applications/MacPython 2.5/IDLE.app/Contents/MacOS/Python -u "/Volumes/Macintosh HD/Users/ag/Desktop/COMPTAS/ ECV/nbtest.py"
execvp(/Applications/MacPython, 2.5/IDLE.app/Contents/MacOS/Python, -u, /Volumes/Macintosh HD/Users/ag/Desktop/COMPTAS/ ECV/nbtest.py) failed with error 2!"
Please note that it happens for applications that works as well as for tests (example: print "oops")
We are not far from the end I hope...
OK. Now it works fine.
I would suggest people in charge of drpython to put this procedure in the ReadMe and to stick it up in the help forum and the website... This will save hours to others to search for good infos and nice people to help...
Thank you all
1) Re-install both python and wxpython with the latest versions.
2) Download TinkerTool to enable access to hidden directories and files. Otherwise,
3) Throw away the former ".drpython" preferences directory (located for me in /Users/MyUserName/Library/Preferences)
4) Install and launch drpython. Close it
5) Go to drPreferences.py and change the "Courier 10 Pitch" and "Sans" fonts with a view to having something like:
defaultfont1="MS Sans Serif"
defaultfont0="Comic Sans MS"#"Courier 10 Pitch"
defaultfont1="Comic Sans MS"#"Sans"
6) Go to preferences.dat in the "/Users/MyUserName/Library/Preferences/.drpython" directory.
There, search for "Sans" and "Sans Serif" and possibly ""Courier 10 Pitch" and replace them with a mac known font (ex: Comic Sans MS). Save.
You can work...
Again thanks to all for your time and your help...
I forgot something.
To launch drpython directly, without having to go through IDLE, right click on the drpython.pyw file, choose open with Python Launcher (make sure to choose the right python launcher if you have several installs).
Thank you Dominique, I added it to the readme.txt and checked it in.