Errin when executing a cgi script that sets a cookie in the browser

Νικόλαος Κούρας nikos.gr33k at gmail.com
Wed Jun 5 23:27:49 EDT 2013


Τη Πέμπτη, 6 Ιουνίου 2013 1:21:08 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 7:18 AM,  <rurpy at yahoo.com> wrote:
> 
> > On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
> 
> >> On Thu, Jun 6, 2013 at 6:56 AM,  <rurpy at yahoo.com> wrote:
> 
> >> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
> 
> >> >>...
> 
> >> >> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
> 
> >> >>...
> 
> >> >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
> 
> >> > (ie, note the two \n's after the "utf-8" test.)
> 
> >>
> 
> >> But that won't solve it either. The default separator for print is a
> 
> >> space, so this will indent his Content-type line by one space.
> 
> >
> 
> > Ah, quite right.  Something like
> 
> >
> 
> >   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
> 
> >
> 
> > then.
> 
> 
> 
> Or change the sep, or concatenate with + instead of using , between
> 
> them. Or put them on separate lines. Anything like that would work.
> 
> And it's really easy to try things out interactively to see what
> 
> they'll do...
> 
> 
> 
> ChrisA

Thi is failing also with same error:

print( cookie )
print( '''Content-type: text/html; charset=utf-8\n''' )
print( message )



More information about the Python-list mailing list