In article 
<[email protected]>,
 Gnarlodious <[email protected]> wrote:

> It does work in Terminal interactively, after I import the sys module.
> But my script doesn't act the same. Here is my entire script:
> 
> #!/usr/bin/python
> print("Content-type:text/plain;charset=utf-8\n\n")
> import sys
> sys.stdout.buffer.write('ùÁÄn'.encode("utf-8"))
> 
> All I get is the despised "Internal Server Error" with Console
> reporting:
> 
> malformed header from script. Bad header=Äxe6Äx99Äx89
> 
> Strangely, if I run the script in Terminal it acts as expected.
> 
> This is OSX 10.6 2,, Python 3.1.1.

Are you sure you are actually using Python 3?  /usr/bin/python is the 
path to the Apple-supplied python 2.6.1.  If you installed Python 3.1.1 
using the python.org OS X installer, the path should be 
/usr/local/bin/python3

-- 
 Ned Deily,
 [email protected]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to