git » blitiri » commit a9293e1

Adjust newlines after 2to3 conversion

author Alberto Bertogli
2022-08-20 19:58:03 UTC
committer Alberto Bertogli
2022-08-20 19:58:03 UTC
parent e1a4cc9fdbec9ef654a1340e1c4852e6559460a0

Adjust newlines after 2to3 conversion

The 2to3 conversion messed up some newlines and caused HTTP headers to
be output in weird ways.

This patch fixes that, and also simplifies the handling (since we can
just use \n these days).

blitiri.cgi +6 -5

diff --git a/blitiri.cgi b/blitiri.cgi
index 69845ec..053161b 100755
--- a/blitiri.cgi
+++ b/blitiri.cgi
@@ -1102,10 +1102,10 @@ def render_html(
     articles, db, actyear=None, show_comments=False, redirect=None, form_data=None
 ):
     if redirect:
-        print("Status: 303 See Other\r\n", end=" ")
-        print("Location: %s\r\n" % redirect, end=" ")
-    print("Content-type: text/html; charset=utf-8\r\n", end=" ")
-    print("\r\n", end=" ")
+        print("Status: 303 See Other")
+        print("Location: %s" % redirect)
+    print("Content-type: text/html; charset=utf-8")
+    print()
     template = Templates(templates_path, db, actyear)
     print(template.get_main_header())
     for a in articles:
@@ -1191,7 +1191,8 @@ def render_atom(articles):
 
 
 def render_style():
-    print("Content-type: text/css\r\n\r\n", end=" ")
+    print("Content-type: text/css")
+    print()
     print(default_css)