> Hi everyone. > I'm getting quite desperate here - trying to run > PythonScripts on asp pages. > The problem seems to be in coding. > This is XP Pro running IIS. Python 2.5 is installed (lates binary > build), egenix mx package too and pywin32-210.win32-py2.5.exe (tried > 209.1 too with the same result). > > Running the asp code:: > > <%@ LANGUAGE = Python %> > <% > # -*- coding: UTF-8 -*- > > def main(): > print ("Hello") > > main() > > %>
Your problem is the 'coding' line. This fails in an ASP environment, as ASP itself has already decoded the string and passes it to Python directly as Unicode. A 'coding' line in Unicode source code makes no sense, and Python complains. But sadly, pywin32 then failed to handle this error correctly. The problem was more severe in Python 2.5 than earlier versions. I've checked a fix for pywin32 in, but this does not solve your original problem; simply remove the coding line, and ensure you use characters in whatever encoding ASP itself expects. Hope this helps, Mark _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32