diff --git a/configure.ac b/configure.ac
index 30b1fc11..9b2b2ae3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([config/m4])
PACKAGE=elinks
-VERSION=0.13.0
+VERSION=0.14.GIT
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package version])
diff --git a/test/cgi/chunked_bzip2.py b/test/cgi/chunked_bzip2.py
index 3e07a174..1d666571 100755
--- a/test/cgi/chunked_bzip2.py
+++ b/test/cgi/chunked_bzip2.py
@@ -1,16 +1,18 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import bz2, os, time
-data1 = '
Two lines should be visible.
The second line.'
+data1 = b'Two lines should be visible.
The second line.'
cd1 = bz2.compress(data1)
length = len(cd1)
next_chunk = hex(length - 10)[2:]
-os.write(1, "Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: bzip2\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
-os.write(1, "\r\na\r\n")
+os.write(1, b"Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: bzip2\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
+os.write(1, b"\r\na\r\n")
os.write(1, cd1[:10])
time.sleep(2)
-os.write(1, "\r\n%s\r\n" % next_chunk)
+os.write(1, b"\r\n")
+os.write(1, bytes(next_chunk, 'iso8859-1'))
+os.write(1, b"\r\n")
os.write(1, cd1[10:])
-os.write(1, "\r\n0\r\n")
+os.write(1, b"\r\n0\r\n")
diff --git a/test/cgi/chunked_deflate.py b/test/cgi/chunked_deflate.py
index 45f06828..01f676dd 100755
--- a/test/cgi/chunked_deflate.py
+++ b/test/cgi/chunked_deflate.py
@@ -1,16 +1,18 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os, time, zlib
-data1 = 'Two lines should be visible.
The second line.'
+data1 = b'Two lines should be visible.
The second line.'
cd1 = zlib.compress(data1)
length = len(cd1)
next_chunk = hex(length - 10)[2:]
-os.write(1, "Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: deflate\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
-os.write(1, "\r\na\r\n")
+os.write(1, b"Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: deflate\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
+os.write(1, b"\r\na\r\n")
os.write(1, cd1[:10])
time.sleep(2)
-os.write(1, "\r\n%s\r\n" % next_chunk)
+os.write(1, b"\r\n")
+os.write(1, bytes(next_chunk, 'iso8859-1'))
+os.write(1, b"\r\n")
os.write(1, cd1[10:])
-os.write(1, "\r\n0\r\n")
+os.write(1, b"\r\n0\r\n")
diff --git a/test/cgi/chunked_gzip.py b/test/cgi/chunked_gzip.py
index e01f6070..9a2fd265 100755
--- a/test/cgi/chunked_gzip.py
+++ b/test/cgi/chunked_gzip.py
@@ -1,9 +1,9 @@
-#!/usr/bin/env python
-import gzip, os, time, StringIO
+#!/usr/bin/env python3
+import gzip, os, time, six
-output = StringIO.StringIO()
+output = six.BytesIO()
-data1 = 'Two lines should be visible.
The second line.'
+data1 = b'Two lines should be visible.
The second line.'
f1 = gzip.GzipFile("/tmp/1.gz", mode = "wb", fileobj=output)
f1.write(data1)
@@ -15,10 +15,12 @@ output.close()
length = len(cd1)
next_chunk = hex(length - 10)[2:]
-os.write(1, "Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: gzip\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
-os.write(1, "\r\na\r\n")
+os.write(1, b"Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: gzip\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
+os.write(1, b"\r\na\r\n")
os.write(1, cd1[:10])
time.sleep(2)
-os.write(1, "\r\n%s\r\n" % next_chunk)
+os.write(1, b"\r\n")
+os.write(1, bytes(next_chunk, 'iso8859-1'))
+os.write(1, b"\r\n")
os.write(1, cd1[10:])
-os.write(1, "\r\n0\r\n")
+os.write(1, b"\r\n0\r\n")
diff --git a/test/cgi/chunked_raw_deflate.py b/test/cgi/chunked_raw_deflate.py
index 6a762636..e318e5c2 100755
--- a/test/cgi/chunked_raw_deflate.py
+++ b/test/cgi/chunked_raw_deflate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os, time
from zlib import *
@@ -6,17 +6,19 @@ from zlib import *
# requires a ZLIB header. However, Microsoft-IIS/6.0 sends a raw
# DEFLATE stream instead. This CGI tests how ELinks handles that.
-data1 = 'Two lines should be visible.
The second line.'
+data1 = b'Two lines should be visible.
The second line.'
ob = compressobj(Z_DEFAULT_COMPRESSION, DEFLATED, -MAX_WBITS)
cd1 = ob.compress(data1)
cd1 += ob.flush()
length = len(cd1)
next_chunk = hex(length - 10)[2:]
-os.write(1, "Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: deflate\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
-os.write(1, "\r\na\r\n")
+os.write(1, b"Date: Sun, 20 Jan 2008 15:24:00 GMT\r\nServer: ddd\r\nTransfer-Encoding: chunked\r\nContent-Encoding: deflate\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-1\r\n")
+os.write(1, b"\r\na\r\n")
os.write(1, cd1[:10])
time.sleep(2)
-os.write(1, "\r\n%s\r\n" % next_chunk)
+os.write(1, b"\r\n")
+os.write(1, bytes(next_chunk, 'iso8859-1'))
+os.write(1, b"\r\n")
os.write(1, cd1[10:])
-os.write(1, "\r\n0\r\n")
+os.write(1, b"\r\n0\r\n")
diff --git a/test/server/crlf.py b/test/server/crlf.py
index 84b49fd1..d0c978a1 100755
--- a/test/server/crlf.py
+++ b/test/server/crlf.py
@@ -1,7 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
-from BaseHTTPServer import *
+from http.server import *
import tempfile
import signal
@@ -19,103 +19,103 @@ F_Hidden = 0
F_TextArea = 1
def encode(ch, encoding):
- if ch == C_CRLF:
- return encode(C_CR, encoding) + encode(C_LF, encoding)
- if ch == C_CR:
- if encoding == E_Raw:
- return "\r"
- if encoding == E_JavaScript:
- return "\\r"
- if encoding == E_Entity:
- return "
"
- if ch == C_LF:
- if encoding == E_Raw:
- return "\n"
- if encoding == E_JavaScript:
- return "\\n"
- if encoding == E_Entity:
- return "
"
+ if ch == C_CRLF:
+ return encode(C_CR, encoding) + encode(C_LF, encoding)
+ if ch == C_CR:
+ if encoding == E_Raw:
+ return "\r"
+ if encoding == E_JavaScript:
+ return "\\r"
+ if encoding == E_Entity:
+ return "
"
+ if ch == C_LF:
+ if encoding == E_Raw:
+ return "\n"
+ if encoding == E_JavaScript:
+ return "\\n"
+ if encoding == E_Entity:
+ return "
"
def get_form(ch, encoding, field):
- text = "foo" + encode(ch, encoding) + "bar"
- if encoding == E_JavaScript:
- text_initial = ""
- else:
- text_initial = text
+ text = "foo" + encode(ch, encoding) + "bar"
+ if encoding == E_JavaScript:
+ text_initial = ""
+ else:
+ text_initial = text
- s = """
+ s = """
Form Test
"
- if encoding == E_JavaScript:
- s += """
+ if field == F_Hidden:
+ s += ''
+ elif field == F_TextArea:
+ s += ''
+ s += "\n"
+ if encoding == E_JavaScript:
+ s += """
""" % (text)
- s += ""
- return s
+ s += "