Rewrite the disallowed characters to only disallow newlines, allowing null bytes. Fixes
import io
import os
import sys
+import re
import platform
import tempfile
import urllib.parse
+import http.client
from http.client import HTTPConnection
import pytest
@@ -398,6 +400,7 @@ class StaticTest(helper.CPWebCase):
self.assertInBody("I couldn't find that thing")
def test_null_bytes(self):
+ http.client._contains_disallowed_url_pchar_re = re.compile(r'[\n]')
self.getPage('/static/\x00')
self.assertStatus('404 Not Found')
