[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)
gandreas software • Error running files developed with TextWrangler
Page 1 of 1

Error running files developed with TextWrangler

Posted: Sat Sep 29, 2007 1:25 pm
by hjenea
I have a number of Python programs which I wrote using TextWrangler. When I try to run them using ScrIDE if the Debugger option on the Python menu is set to anything other than 'None', I get the following error msg.:

Traceback (most recent call last):
File "/Applications/ScrIDE_0.4 2/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources/ScrIDEBug.py", line 1038, in <module>
ScrIDEBugModule = compile(ScrIDEBugSource, ScrIDEBugSourceFile, "exec")
File "/Users/enea/Desktop/test.py", line 1
import wx

^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/Applications/ScrIDE_0.4 2/ScrIDE.app/Contents/PlugIns/Python.plugin/Contents/Resources/ScrIDEBug.py", line 1054, in <module>
print "*syntax,file=\"%s\",msg=\"%s\",line=\"%d\",offset=\"%d\"" % (sys.argv[1],ScrIDEBugException.msg, ScrIDEBugException.lineno, ScrIDEBugException.offset)
IndexError: list index out of range

The program in this case is just:

import wx

If I type this program using the ScrIDE editor it works with every debugger setting. When I save the ScrIDE file and use a 'file compare' program to compare it to my TextWrangler program, they are identical.

What's going on here?

By the way, is ScrIDE being supported, and is it a good idea to rely on it as my main Python IDE. On a feature by feature basis I think that it's the best IDE available on the Mac

Horace Enea

Posted: Sat Sep 29, 2007 8:53 pm
by gandreas
My guess is that one file has a "Mac OS" style line ending (hex 0x0d) instead of a "Unix" style line ending (hex 0x0a).

You can see this by, in the command line in a terminal window, with the following command:

hexdump -C file.py

(where file.py, of course, is the name of you file).

Posted: Sun Sep 30, 2007 12:28 pm
by hjenea
Thanks for the reply. I did a hexdump as you suggested. The line endings were Cr. As you suggested UNIX line endings, Lf, work.

Horace