Python/ASP local characters and 500 server error

M

Martin

Using Python / ASP on a IIS server with Mark Hammond's win32 extensions,
i have the following problem.

All occurences of local characters (fx. danish æøå) in comments or in
strings result in a HTTP/1.1 500 Server Error.

Is there a solution to this problem?

/Martin
 
F

Fredrik Lundh

Martin said:
Using Python / ASP on a IIS server with Mark Hammond's win32 extensions,
i have the following problem.

All occurences of local characters (fx. danish æøå) in comments or in
strings result in a HTTP/1.1 500 Server Error.

Is there a solution to this problem?

the first thing to do when you get a server error is to look in the server logs
to see what the real error is.

in this case, chances are that you'll see a warning message from the Python
interpreter that points to you this page:

http://www.python.org/peps/pep-0263.html

(scroll down to "Examples" to see the solution)

</F>
 
M

Martin

Fredrik said:

Using the info from pep-0263, adding a line in the start for the file:

# -*- coding: <charcode> -*-

works for .py files, but the error i get is from an .asp file.

The logfile contains this info:

ASP_0147|500_Server_Error 500

A solution is to move ALL code from the .asp page to a .py file and
import it on the .asp page.

But there must be another solution?

/Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top