File tree 2 files changed +9
-1
lines changed
tools/wptserve/wptserve/cgi
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ def initlog(*allargs):
89
89
DeprecationWarning , stacklevel = 2 )
90
90
if logfile and not logfp :
91
91
try :
92
- logfp = open (logfile , "a" , encoding = "locale" )
92
+ kwargs = {}
93
+ if sys .version_info > (3 , 9 ):
94
+ kwargs ["encoding" ] = "locale"
95
+ logfp = open (logfile , "a" , ** kwargs )
93
96
except OSError :
94
97
pass
95
98
if not logfp :
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ class HackedSysModule:
74
74
# will completely confuse the test of the cgi module
75
75
argv = []
76
76
stdin = sys .stdin
77
+ version_info = sys .version_info
77
78
78
79
cgi .sys = HackedSysModule ()
79
80
@@ -153,6 +154,10 @@ def do_test(buf, method):
153
154
})
154
155
]
155
156
157
+ # The behaviour of urllib.parse.parse_qs with empty input changed in Python 3.11
158
+ if sys .version_info < (3 , 11 ):
159
+ parse_strict_test_cases [0 ] = ("" , ValueError ("bad query field: ''" ))
160
+
156
161
def norm (seq ):
157
162
return sorted (seq , key = repr )
158
163
You can’t perform that action at this time.
0 commit comments