attach_journal_errors is causing a ValueError crash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Fix Released
|
Medium
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Kinetic |
Fix Released
|
Medium
|
Unassigned |
Bug Description
As seen in https:/
Traceback (most recent call last):
File "/usr/lib/
symb[
File "/usr/share/
apport.
File "/usr/lib/
crash_time = report.get_date()
File "/usr/lib/
return datetime.
File "/usr/lib/
tt, fraction, gmtoff_fraction = _strptime(
File "/usr/lib/
raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Sun Jun 12 19:52:55 2022' does not match format '%a %b %d %H:%M:%S %Y'
This bug is a regression of the fix of bug #1962454.
tags: | added: rls-kk-incoming |
tags: | added: fr-2483 |
summary: |
- attach_journal_errors is create a ValueError crash + attach_journal_errors is causing a ValueError crash |
Changed in apport: | |
milestone: | none → 2.22.0 |
Changed in apport (Ubuntu): | |
importance: | Undecided → Medium |
Changed in apport: | |
importance: | Undecided → Medium |
tags: | removed: rls-kk-incoming |
Changed in apport: | |
status: | Fix Committed → Fix Released |
description: | updated |
I tried to reproduce this failure with following python snippet in a kinetic schroot:
```python datetime. strptime( date, '%a %b %d %H:%M:%S %Y'))
#!/usr/bin/python3
import datetime
date = 'Sun Jun 12 19:52:55 2022'
print(datetime.
```
Regardless how I call this script, it always succeeds to parse the date string. Example:
``` nb_NO:nb: no_NO:no: nn_NO:nn: en LANG=nb_NO.UTF-8 ./test.py
$ env -i LANGUAGE=
2022-06-12 19:52:55
$ env -i LANGUAGE=C LANG=C.UTF-8 ./test.py
2022-06-12 19:52:55
$ env -i ./test.py
2022-06-12 19:52:55
```
Python's _strptime checks that the provided data_string is an instance of str. passing a wrong type to strptime can be ruled out as well.