Repository navigation
Test failures with Python 3.12 b1 & b2 #3278
Copy link
Copy link
Closed
Description
Hello,
I'd like to ask for help with tornado and its compatibility with Python 3.12. Up until the 7th alpha tornado was building fine. I started to see the following failures with the 1st beta. You can see the failure also in CI of this PR #3277.
Thank you.
======================================================================
FAIL: test_chunked (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_chunked)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 225, in test_chunked
self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']
First differing element 0:
b'asdfqwer'
b'asdf'
Second list contains 1 additional elements.
First extra element 1:
b'qwer'
- [b'asdfqwer']
+ [b'asdf', b'qwer']
? +++++
======================================================================
FAIL: test_gzip (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_gzip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 438, in test_gzip
self.assertEqual(len(response.body), 34)
AssertionError: 28 != 34
======================================================================
FAIL: test_header_callback (tornado.test.httpclient_test.HTTPClientCommonTestCase.test_header_callback)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 484, in test_header_callback
self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']
First differing element 0:
b'asdfqwer'
b'asdf'
Second list contains 1 additional elements.
First extra element 1:
b'qwer'
- [b'asdfqwer']
+ [b'asdf', b'qwer']
? +++++
======================================================================
FAIL: test_chunked (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_chunked)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 225, in test_chunked
self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']
First differing element 0:
b'asdfqwer'
b'asdf'
Second list contains 1 additional elements.
First extra element 1:
b'qwer'
- [b'asdfqwer']
+ [b'asdf', b'qwer']
? +++++
======================================================================
FAIL: test_gzip (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_gzip)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 438, in test_gzip
self.assertEqual(len(response.body), 34)
AssertionError: 28 != 34
======================================================================
FAIL: test_header_callback (tornado.test.simple_httpclient_test.SimpleHTTPClientCommonTestCase.test_header_callback)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/tornado-6.3.2/tornado/testing.py", line 102, in __call__
result = self.orig_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/tornado-6.3.2/tornado/test/httpclient_test.py", line 484, in test_header_callback
self.assertEqual(chunks, [b"asdf", b"qwer"])
AssertionError: Lists differ: [b'asdfqwer'] != [b'asdf', b'qwer']
First differing element 0:
b'asdfqwer'
b'asdf'
Second list contains 1 additional elements.
First extra element 1:
b'qwer'
- [b'asdfqwer']
+ [b'asdf', b'qwer']
? +++++
----------------------------------------------------------------------
Ran 1189 tests in 17.011s
FAILED (failures=6, skipped=66)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
bdarnell commentedon Jun 15, 2023
This is a bug introduced by a change to the python standard library's gzip module: python/cpython#105808. Hopefully it'll get fixed in an upcoming beta.
There are also other things that broke with the 3.12 betas: we need to upgrade tox, and there are some deprecation warnings in datetime that we have to work around. I have patches for those issues but there's no clean way to work around the GzipFile bug so I'm going to disable 3.12 in CI until the fix comes out.