[Bug 2146806] [NEW] Python TypeErrors

Laurent Bonnaud 2146806 at bugs.launchpad.net
Mon Mar 30 15:01:47 UTC 2026


Public bug reported:

Hi,

plasmashell crashed on my system, and when apport tried to upload the
problem report, 2 Python errors occurred:

TypeError: cannot use a string pattern on a bytes-like object
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Here is more context:

# journalctl -b | grep whoopsie-upload-all
Mar 30 16:54:18 vougeot whoopsie-upload-all[12777]: INFO:root:Collecting info for /var/crash/_usr_bin_plasmashell.1000.crash...
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: ERROR: hook /usr/share/apport/general-hooks/generic.py crashed:
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: Traceback (most recent call last):
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 314, in _run_hook
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     symb["add_info"](report, ui)
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/general-hooks/generic.py", line 70, in add_info
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     for lib in re.finditer(r"\s(/[^ ]+\.so[.0-9]*)$", report["ProcMaps"], re.M):
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:                ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3.14/re/__init__.py", line 285, in finditer
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     return _compile(pattern, flags).finditer(string)
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: TypeError: cannot use a string pattern on a bytes-like object
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]: Traceback (most recent call last):
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 246, in <module>
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     main()
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     ~~~~^^
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 228, in main
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     stamps = collect_info()
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 162, in collect_info
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     res = process_report(r)
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 112, in process_report
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     r.add_gdb_info()
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     ~~~~~~~~~~~~~~^^
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 1057, in add_gdb_info
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     addr_signature = self.crash_signature_addresses()
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 1797, in crash_signature_addresses
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     if self["ProcMaps"].startswith("Error: "):
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]: TypeError: startswith first arg must be bytes or a tuple of bytes, not str

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: apport 2.33.1-0ubuntu7
Uname: Linux 6.19.10-zabbly+ x86_64
ApportVersion: 2.33.1-0ubuntu7
Architecture: amd64
CasperMD5CheckResult: unknown
CrashReports:
 644:1000:110:0:2026-03-30 16:51:25.793400247 +0200:2026-03-30 16:51:25.793400247 +0200:/var/crash/_usr_lib_x86_64-linux-gnu_libexec_drkonqi.1000.upload
 640:1000:110:1561169:2026-03-30 16:51:25.793400247 +0200:2026-03-30 16:51:25.820400248 +0200:/var/crash/_usr_lib_x86_64-linux-gnu_libexec_drkonqi.1000.crash
 640:1000:110:48950892:2026-03-30 16:51:26.564400251 +0200:2026-03-30 16:54:18.693028271 +0200:/var/crash/_usr_bin_plasmashell.1000.crash
 640:0:110:24050:2026-03-30 16:54:22.381500008 +0200:2026-03-30 16:54:22.380028258 +0200:/var/crash/_usr_share_apport_whoopsie-upload-all.0.crash
CurrentDesktop: KDE
Date: Mon Mar 30 16:55:51 2026
PackageArchitecture: all
SourcePackage: apport
UpgradeStatus: Upgraded to resolute on 2026-03-29 (1 days ago)

** Affects: apport (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/2146806

Title:
  Python TypeErrors

Status in apport package in Ubuntu:
  New

Bug description:
  Hi,

  plasmashell crashed on my system, and when apport tried to upload the
  problem report, 2 Python errors occurred:

  TypeError: cannot use a string pattern on a bytes-like object
  TypeError: startswith first arg must be bytes or a tuple of bytes, not str

  Here is more context:

  # journalctl -b | grep whoopsie-upload-all
  Mar 30 16:54:18 vougeot whoopsie-upload-all[12777]: INFO:root:Collecting info for /var/crash/_usr_bin_plasmashell.1000.crash...
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: ERROR: hook /usr/share/apport/general-hooks/generic.py crashed:
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: Traceback (most recent call last):
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 314, in _run_hook
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     symb["add_info"](report, ui)
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/general-hooks/generic.py", line 70, in add_info
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     for lib in re.finditer(r"\s(/[^ ]+\.so[.0-9]*)$", report["ProcMaps"], re.M):
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:                ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3.14/re/__init__.py", line 285, in finditer
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:     return _compile(pattern, flags).finditer(string)
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  Mar 30 16:54:20 vougeot whoopsie-upload-all[12777]: TypeError: cannot use a string pattern on a bytes-like object
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]: Traceback (most recent call last):
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 246, in <module>
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     main()
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     ~~~~^^
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 228, in main
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     stamps = collect_info()
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 162, in collect_info
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     res = process_report(r)
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/share/apport/whoopsie-upload-all", line 112, in process_report
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     r.add_gdb_info()
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     ~~~~~~~~~~~~~~^^
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 1057, in add_gdb_info
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     addr_signature = self.crash_signature_addresses()
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:   File "/usr/lib/python3/dist-packages/apport/report.py", line 1797, in crash_signature_addresses
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:     if self["ProcMaps"].startswith("Error: "):
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]:        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  Mar 30 16:54:22 vougeot whoopsie-upload-all[12777]: TypeError: startswith first arg must be bytes or a tuple of bytes, not str

  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: apport 2.33.1-0ubuntu7
  Uname: Linux 6.19.10-zabbly+ x86_64
  ApportVersion: 2.33.1-0ubuntu7
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CrashReports:
   644:1000:110:0:2026-03-30 16:51:25.793400247 +0200:2026-03-30 16:51:25.793400247 +0200:/var/crash/_usr_lib_x86_64-linux-gnu_libexec_drkonqi.1000.upload
   640:1000:110:1561169:2026-03-30 16:51:25.793400247 +0200:2026-03-30 16:51:25.820400248 +0200:/var/crash/_usr_lib_x86_64-linux-gnu_libexec_drkonqi.1000.crash
   640:1000:110:48950892:2026-03-30 16:51:26.564400251 +0200:2026-03-30 16:54:18.693028271 +0200:/var/crash/_usr_bin_plasmashell.1000.crash
   640:0:110:24050:2026-03-30 16:54:22.381500008 +0200:2026-03-30 16:54:22.380028258 +0200:/var/crash/_usr_share_apport_whoopsie-upload-all.0.crash
  CurrentDesktop: KDE
  Date: Mon Mar 30 16:55:51 2026
  PackageArchitecture: all
  SourcePackage: apport
  UpgradeStatus: Upgraded to resolute on 2026-03-29 (1 days ago)

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




More information about the foundations-bugs mailing list