[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-22 Thread Benjamin Drung
** Changed in: apport
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in Apport:
  Fix Released
Status in apport package in Ubuntu:
  Fix Released
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Fix Released
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-22 Thread Benjamin Drung
** Also affects: apport
   Importance: Undecided
   Status: New

** Changed in: apport
Milestone: None => 2.28.0

** Changed in: apport
   Status: New => Fix Committed

** Changed in: apport
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in Apport:
  Fix Committed
Status in apport package in Ubuntu:
  Fix Released
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Fix Released
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-17 Thread Launchpad Bug Tracker
This bug was fixed in the package apport - 2.27.0-0ubuntu7

---
apport (2.27.0-0ubuntu7) noble; urgency=medium

  [ Benjamin Drung ]
  * Rely on pybuild in dh_auto_* targets
  * Introduce the separate apport-core-dump-handler package that registers as
kernel crash dump handler. This is needed for the upcoming systemd-coredump
support.
  * Move systemd units from /lib to /usr/lib

  [ Simon Chopin ]
  * Rework apport-retrace to handle unbound crashid (LP: #2051512)
  * fix: use context manager when manipulating GzipFiles (LP: #2051512)

 -- Benjamin Drung   Wed, 14 Feb 2024 16:51:44 +0100

** Changed in: apport (Ubuntu Noble)
   Status: Confirmed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in apport package in Ubuntu:
  Fix Released
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Fix Released
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-14 Thread Launchpad Bug Tracker
** Merge proposal linked:
   
https://code.launchpad.net/~ubuntu-core-dev/ubuntu/+source/apport/+git/apport/+merge/458513

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in apport package in Ubuntu:
  Confirmed
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Confirmed
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-09 Thread Simon Chopin
After further investigations into the gzip issue in python 3.12, it
turns out there was an undocumented change: it is now a buffered writer.
So the fire pattern used in the snippet above doesn't work
anymore, we now need to use it as a proper IO object instead.

I still think this should be reported upstream because of the
documentation issue, but I'll work on changing the apport code to Do The
Right Thing.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in apport package in Ubuntu:
  Confirmed
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Confirmed
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-09 Thread Simon Chopin
** Also affects: python3.12 (Ubuntu)
   Importance: Undecided
   Status: New

** Description changed:

-debian/rules override_dh_auto_test
+ [Description]
+ 
+ Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
+ (maybe all?)
+ 
+ [Test Plan]
+ 
+ Run the following script:
+ 
+ import gzip
+ import io
+ out = io.BytesIO()
+ gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
+ # print(out.getvalue())
+ print(gzip.decompress(out.getvalue()))
+ 
+ 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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in apport package in Ubuntu:
  Confirmed
Status in python3-defaults package in Ubuntu:
  New
Status in python3.12 package in Ubuntu:
  New
Status in apport source package in Noble:
  Confirmed
Status in python3-defaults source package in Noble:
  New
Status in python3.12 source package in Noble:
  New

Bug description:
  [Description]

  Python 3.12 gzip.GZipFile.write() outputs truncated data in some cases
  (maybe all?)

  [Test Plan]

  Run the following script:

  import gzip
  import io
  out = io.BytesIO()
  gzip.GzipFile("foo", mode="wb", fileobj=out, mtime=0).write(b"FooFoo")
  # print(out.getvalue())
  print(gzip.decompress(out.getvalue()))

  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_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-08 Thread Julian Andres Klode
** Tags removed: rls-nn-incoming
** Tags added: foundations-todo

** Also affects: apport (Ubuntu Noble)
   Importance: High
   Status: Confirmed

** Also affects: python3-defaults (Ubuntu Noble)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/2051512

Title:
  apport ftbfs with Python 3.12 as the default

Status in apport package in Ubuntu:
  Confirmed
Status in python3-defaults package in Ubuntu:
  New
Status in apport source package in Noble:
  Confirmed
Status in python3-defaults source package in Noble:
  New

Bug description:
 debian/rules override_dh_auto_test
  make[1]: Entering directory '/<>'
  tests/run-linters --errors-only
  Skipping mypy tests, mypy is not installed
  Running pylint...
  * Module apport-retrace
  bin/apport-retrace:577:44: E0601: Using variable 'crashid' before assignment 
(used-before-assignment)
  make[1]: *** [debian/rules:23: override_dh_auto_test] Error 2
  make[1]: Leaving directory '/<>'
  make: *** [debian/rules:4: binary] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2051512/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 2051512] Re: apport ftbfs with Python 3.12 as the default

2024-02-01 Thread Vladimir Petko
After fixing uninitialized variable or ignoring linter, the following
test failures occur:


=== FAILURES ===
_ TestApportUnpack.test_unpack _

self = 

def test_unpack(self):
"""apport-unpack for all possible data types"""
process = self._call_apport_unpack([self.report_file, self.unpack_dir])
self.assertEqual(process.returncode, 0)
self.assertEqual(process.stderr, "")
self.assertEqual(process.stdout, "")

self.assertEqual(self._get_unpack("utf8"), self.utf8_str)
self.assertEqual(self._get_unpack("unicode"), self.utf8_str)
self.assertEqual(self._get_unpack("binary"), self.bindata)
>   self.assertEqual(self._get_unpack("compressed"), b"FooFoo!")
E   AssertionError: b'' != b'FooFoo!'

tests/integration/test_apport_unpack.py:65: AssertionError
___ T.test_compressed_values ___

self = 

def test_compressed_values(self):
"""Handle of CompressedValue values."""
large_val = b"A" * 500

pr = problem_report.ProblemReport()
pr["Foo"] = problem_report.CompressedValue(b"FooFoo!")
pr["Bin"] = problem_report.CompressedValue()
pr["Bin"].set_value(bin_data)
pr["Large"] = problem_report.CompressedValue(large_val)

self.assertTrue(isinstance(pr["Foo"], problem_report.CompressedValue))
self.assertTrue(isinstance(pr["Bin"], problem_report.CompressedValue))
>   self.assertEqual(pr["Foo"].get_value(), b"FooFoo!")

tests/integration/test_problem_report.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
problem_report.py:79: in get_value
return gzip.GzipFile(fileobj=io.BytesIO(self.gzipvalue)).read()
/usr/lib/python3.12/gzip.py:324: in read
return self._buffer.read(size)
/usr/lib/python3.12/_compression.py:118: in readall
while data := self.read(sys.maxsize):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , size =
9223372036854775807

def read(self, size=-1):
if size < 0:
return self.readall()
# size=0 is special because decompress(max_length=0) is not supported
if not size:
return b""

# For certain input data, a single
# call to decompress() may not return
# any data. In this case, retry until we get some data or reach EOF.
while True:
if self._decompressor.eof:
# 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
self._read_eof()
self._new_member = True
self._decompressor = self._decomp_factory(
**self._decomp_args)

if self._new_member:
# If the _new_member flag is set, we have to
# jump to the next member, if there is one.
self._init_read()
if not self._read_gzip_header():
self._size = self._pos
return b""
self._new_member = False

# Read a chunk of data from the file
if self._decompressor.needs_input:
buf = self._fp.read(READ_BUFFER_SIZE)
uncompress = self._decompressor.decompress(buf, size)
else:
uncompress = self._decompressor.decompress(b"", size)

if self._decompressor.unused_data != b"":
# Prepend the already read bytes to the fileobj so they can
# be seen by _read_eof() and _read_gzip_header()
self._fp.prepend(self._decompressor.unused_data)

if uncompress != b"":
break
if buf == b"":
>   raise EOFError("Compressed file ended before the "
   "end-of-stream marker was reached")
E   EOFError: Compressed file ended before the end-of-stream marker 
was reached

/usr/lib/python3.12/gzip.py:547: EOFError
_ T.test_extract_keys __

self = 

def test_extract_keys(self):
"""extract_keys() with various binary elements."""
# create a test report with binary elements
large_val = b"A" * 500

pr = problem_report.ProblemReport()
pr["Txt"] = "some text"
pr["MoreTxt"] = "some more text"
pr["Foo"] = problem_report.CompressedValue(b"FooFoo!")
pr["Uncompressed"] = bin_data
pr["Bin"] = problem_report.CompressedValue()
pr["Bin"].set_value(bin_data)
pr["Large"] = problem_report.CompressedValue(large_val)
pr["Multiline"] =