jenndhemus / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

[pytools] Crash on select python installation #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
On OSX:

I wasn't sure what the installation directory was supposed to be for the
dialog by the caption text it looked like it should be the top level one so
I chose:

/Library/Frameworks/Python.Framework/Versions/Current/

Then I got this error:

*** Thu Mar  5 19:42:08 2009 ***
Traceback (most recent call last):
  File
"//usr/local/lib/wxPython-unicode-2.8.9.2/lib/python2.5/site-packages/wx-2.8-mac
-unicode/wx/lib/eventStack.py",
line 108, in HandleEvent
    return handler(event)
  File
"/Users/codyprecord/Desktop/devel/Editra/plugins/editra-plugins/trunk/pytools/py
tools/__init__.py",
line 111, in OnOpenModule
    path = finder.GetSearchPath(base)
  File
"/Users/codyprecord/Desktop/devel/Editra/plugins/editra-plugins/trunk/pytools/py
tools/finder.py",
line 63, in GetSearchPath
    for f in os.listdir(dir):
OSError: [Errno 2] No such file or directory:
'/Library/Frameworks/Python.framework/Versions/2.5/site-packages'

This error should definitely be caught and an error dialog should explain
the error. The caption text on the selection dialog should maybe also be
clearer on what directory we are looking for.

Original issue reported on code.google.com by CodyPrec...@gmail.com on 6 Mar 2009 at 1:48

GoogleCodeExporter commented 8 years ago
I should use a different caption depending on platform because it is not clear 
which is the library basepath. 
On windows it's intuitive: it's the toplevel python directory (C:\pythonXX, 
same as sys.prefix). 
On unix it's the toplevel lib directory (sys.prefix + /lib/python-<version> 
where sys.prefix it is usually '/usr'). 
I see now that on MacOSX there is a distinction between a Framework install 
(aka apple python) and a standard 
install (that follows the same unix rules described above and in the python 
docs). 

Which was the correct toplevel directory on your Framework install? 

Original comment by rudi.pet...@gmail.com on 6 Mar 2009 at 10:30

GoogleCodeExporter commented 8 years ago
The correct one was

/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5

Note that the 'Current' part of the path is just a soft link, the real path 
will be
the python version number i.e) 2.5, 2.6, 2.4, etc...

So I am thinking that the text would be clear if it said the python 
installations
library directory, because doesn't it contain what we are looking for and the
site-packages directory on all platforms?

This might not be so much of an issue when we get the configuration dialog 
ready.

Cody

Original comment by CodyPrec...@gmail.com on 6 Mar 2009 at 1:31

GoogleCodeExporter commented 8 years ago
Yes, my research is based on the "invariant" that below the root library 
directory
(the one with user.py, string.py, etc) there is the site-packages-dir (and from 
there
you can look for .pth files). This wasn't valid on older win32 install but now 
afaik
it's valid everywhere. The site doc and the source of the standard module 
"site.py"
seems to confirm this. That module contains one more check if platform == 
'darwin'.
In that case it searches for a second site-packages dir under
$HOME/Library/Python/version/.

I committed a few improvements: a check that the choosen directory contains the
site-packages dir and better messages. I plan to extend the chooser dialog so 
that it
shows the list of directories calculated by the GetSearchPath function.

Original comment by rudi.pet...@gmail.com on 7 Mar 2009 at 2:11

GoogleCodeExporter commented 8 years ago
Hello (rudi),

This seems fixed too? If you have verified your fix can you please close this 
issue.

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 16 Mar 2009 at 10:28

GoogleCodeExporter commented 8 years ago

Original comment by rudi.pet...@gmail.com on 17 Mar 2009 at 10:14