apport ftbfs with Python 3.12 as the default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Fix Released
|
High
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Noble |
Fix Released
|
High
|
Unassigned | ||
python3-defaults (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Noble |
New
|
Undecided
|
Unassigned | ||
python3.12 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Noble |
New
|
Undecided
|
Unassigned |
Bug Description
[Description]
Python 3.12 gzip.GZipFile.
[Test Plan]
Run the following script:
import gzip
import io
out = io.BytesIO()
gzip.GzipFile(
# print(out.
print(gzip.
Expected output (as on Python 3.11):
FooFoo
Buggy output (tail end of the stack trace):
EOFError: Compressed file ended before the end-of-stream marker was reached
[Original report]
debian/rules override_
make[1]: Entering directory '/<<PKGBUILDDIR>>'
tests/run-linters --errors-only
Skipping mypy tests, mypy is not installed
Running pylint...
************* Module apport-retrace
bin/apport-
make[1]: *** [debian/rules:23: override_
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:4: binary] Error 2
Related branches
- Simon Chopin: Needs Fixing
- git-ubuntu import: Pending requested
-
Diff: 449 lines (+318/-22)10 files modifieddebian/apport-core-dump-handler.install (+2/-0)
debian/apport.install (+4/-2)
debian/changelog (+15/-0)
debian/control (+18/-3)
debian/patches/apport-retrace-split-out-report-loading-into-its-own-func.patch (+132/-0)
debian/patches/fix-use-context-manager-when-manipulating-GzipFiles-LP-20.patch (+109/-0)
debian/patches/retrace-directly-test-crashid-relevance.patch (+34/-0)
debian/patches/series (+3/-0)
debian/rules (+1/-16)
dev/null (+0/-1)
Changed in apport (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
tags: | added: ftbfs rls-nn-incoming |
tags: |
added: foundations-todo removed: rls-nn-incoming |
description: | updated |
Changed in apport: | |
milestone: | none → 2.28.0 |
status: | New → Fix Committed |
importance: | Undecided → High |
Changed in apport: | |
status: | Fix Committed → Fix Released |
After fixing uninitialized variable or ignoring linter, the following test failures occur:
======= ======= ======= ======= ======= FAILURES ======= ======= ======= ======= ======= _______ _______ ____ TestApportUnpac k.test_ unpack _______ _______ _______ ____
_______
self = <tests. integration. test_apport_ unpack. TestApportUnpac k testMethod= test_unpack>
def test_unpack(self):
"""apport- unpack for all possible data types""" apport_ unpack( [self.report_ file, self.unpack_dir])
self.assertEqu al(process. returncode, 0)
self.assertEqu al(process. stderr, "")
self.assertEqu al(process. stdout, "")
process = self._call_
> self.assertEqua
E AssertionError: b'' != b'FooFoo!'
tests/integrati on/test_ apport_ unpack. py:65: AssertionError _______ _______ ______ T.test_ compressed_ values _______ _______ _______ ______
_______
self = <tests. integration. test_problem_ report. T testMethod= test_compressed _values>
def test_compressed _values( self):
"""Handle of CompressedValue values."""
large_val = b"A" * 5000000
pr = problem_ report. ProblemReport( ) report. CompressedValue (b"FooFoo! ") report. CompressedValue ()
pr["Bin" ].set_value( bin_data) report. CompressedValue (large_ val)
pr["Foo"] = problem_
pr["Bin"] = problem_
pr["Large"] = problem_
> self.assertEqua
tests/integrati on/test_ problem_ report. py:42: report. py:79: in get_value fileobj= io.BytesIO( self.gzipvalue) ).read( ) python3. 12/gzip. py:324: in read read(size) python3. 12/_compression .py:118: in readall sys.maxsize) :
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
problem_
return gzip.GzipFile(
/usr/lib/
return self._buffer.
/usr/lib/
while data := self.read(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gzip._GzipReader object at 0x7f287a41e260>, size = 9223372036854775807
def read(self, size=-1): max_length= 0) is not supported
if size < 0:
return self.readall()
# size=0 is special because decompress(
if not size:
return b""
# For certain input data, a single sor.eof:
self. _read_eof( )
self. _new_member = True
self. _decompressor = self._decomp_ factory(
# call to decompress() may not return
# any data. In this case, retry until we get some data or reach EOF.
while True:
if self._decompres
# Ending case: we've come to the end of a member in the file,
# so finish up this member, and read a new gzip header.
# Check the CRC and file size, and set the flag so we read
# a new member
...