Modul loading and random crashes

A extensible, generic scripting IDE
Post Reply
anderscth
Posts: 3
Joined: Wed Jan 03, 2007 11:04 am

Modul loading and random crashes

Post by anderscth » Wed Jan 03, 2007 11:19 am

Thanks for a very good program!
I have a small issue on loading modules, when running a simple example as in http://www.swaroopch.info/text/Byte_of_Python:Modules I get an exception:

Traceback (most recent call last):
------
File /Users/anek/Desktop/temp/Python_test/mymodule_demo.py, line 4, in ?
import mymodule
------
ImportError: No module named mymodule

The calling file and the file containing the module have been placed in the same directory, but ScrIDE does not seem to find it. Is there a workaround to this or do I need to explicitly add the directory to the sys.path?

The second issue is what appears to be more or less random crashes. They seem to be related to setting break points for debugging. Would a crash log be of use or are you aware of the problem?

Still, this is a very good editor that has considerably speeded up my programming.
Many thanks!
Anders

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Post by gandreas » Wed Jan 03, 2007 4:54 pm

The calling file and the file containing the module have been placed in the same directory, but ScrIDE does not seem to find it. Is there a workaround to this or do I need to explicitly add the directory to the sys.path?
I just tried making two files in temporary directory, one importing the other, and everything seemed to work fine.

If you make a simple file that just does:

Code: Select all

import sys
print sys.path
and run that, is the current directory (where the file lives) listed?

Did you ever explicitly set up our $PYTHONPATH to something?
The second issue is what appears to be more or less random crashes. They seem to be related to setting break points for debugging. Would a crash log be of use or are you aware of the problem?
Crash logs are, unfortunately, always welcome, especially if you've got reproducible steps to cause the problem to happen as will. I've got some bug fixes for the next version, but they are more oriented to the editor (fixing some strange errors and minor cosmetic problems with unicode characters, for example).

anderscth
Posts: 3
Joined: Wed Jan 03, 2007 11:04 am

Post by anderscth » Thu Jan 04, 2007 7:35 am

Thanks for a very fast response!
gandreas wrote:If you make a simple file that just does:

Code: Select all

import sys
print sys.path
and run that, is the current directory (where the file lives) listed?
No. I enclose the output below just in case it can give you a hint:
['/Applications/ScrIDE_0.4/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', '/Users/anek/Library/Python/2.4/site-packages', '/Users/anek/Library/Python/2.4/site-packages/Numeric']

and when I specify running with system default (Pythin 2.3) I get:
&[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)]
&
*stopped,reason="ready-to-run"
^running
@['/Applications/ScrIDE_0.4/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python']
*stopped,reason="exited-normally"
^exit

In contrast the directory is included (first item) when I run from the Terminal:
['/Users/anek/Desktop/temp/Python_test', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', '/Users/anek/Library/Python/2.4/site-packages', '/Users/anek/Library/Python/2.4/site-packages/Numeric']
Did you ever explicitly set up our $PYTHONPATH to something?
No, not that I can recall (and I get the same problem on two separate computers).
Crash logs are, unfortunately, always welcome, especially if you've got reproducible steps to cause the problem to happen as will. I've got some bug fixes for the next version, but they are more oriented to the editor (fixing some strange errors and minor cosmetic problems with unicode characters, for example).
A hint on the cause could be that I think the error is reproducible if you run a program that causes an exception (like my module example above). Click Terminate, close the console window (by clicking the red dot) and mark a debugger break point. At least that way it is reproducible for me. I put llogs for two such crashes at
http://homepage.mac.com/anek/Download/crash_log.txt

/Anders

scotsman
Posts: 4
Joined: Fri Dec 22, 2006 9:55 pm

Post by scotsman » Fri Jan 05, 2007 7:09 pm

I too have the same problem trying to import a python file in the same directory as the original. File path also doesn't show when I run the program as you described, just the library paths are listed, similar to above. PYTHONPATH is not set and when I set it nothing changes. I am not using the debugger.

If it helps I always get the message:-

"unable to put task 261(/usr/local/bin/python) into same group as self"

when I start up ScrIDE. Don't know why it says that because my Python is in the frameworks library.

Anyway, hope this helps in some way as this is such a good editor and any enhancements/improvements will be very welcome.

gandreas
Immortal
Posts: 1464
Joined: Wed Feb 04, 2004 6:02 pm
Contact:

Post by gandreas » Fri Jan 05, 2007 7:16 pm

scotsman wrote:"unable to put task 261(/usr/local/bin/python) into same group as self"

when I start up ScrIDE. Don't know why it says that because my Python is in the frameworks library.
This is the "helper" python process that does things like helping with file completion, etc...

And why it sometimes can put the task into the same process group and sometimes not, I'm at a bit of a loss. All that error means is that if ScrIDE crashes, the helper process may keep running (i.e., it's a purely defensive maneuver).

anderscth
Posts: 3
Joined: Wed Jan 03, 2007 11:04 am

Post by anderscth » Mon Jan 08, 2007 9:53 am

scotsman wrote:If it helps I always get the message:-

"unable to put task 261(/usr/local/bin/python) into same group as self"
I can confirm that I consistently get the same error message on start-up.
/Anders

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests