Bug 1262726

Summary: [abrt] timeline: experimentalfeaturedateformatting.py:96:_get_field_positions:IndexError: list index out of range
Product: [Fedora] Fedora Reporter: Tong Hui <tonghuix>
Component: timelineAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: gwync, ricli85
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/054cd06aaba382a46116173e82e1941102336657
Whiteboard: abrt_hash:d3f23d4cdc2f6b864e0ed5a4e19fc0acd795b298
Fixed In Version: timeline-1.5.1-1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-17 08:52:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Tong Hui 2015-09-14 08:12:03 UTC
Version-Release number of selected component:
timeline-1.5.0-1.fc22

Additional info:
reporter:       libreport-2.6.2
cmdline:        python /usr/bin/timeline
executable:     /usr/bin/timeline
kernel:         4.1.6-200.fc22.x86_64+debug
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
experimentalfeaturedateformatting.py:96:_get_field_positions:IndexError: list index out of range

Traceback (most recent call last):
  File "/usr/bin/timeline", line 56, in <module>
    from timelinelib.wxgui.setup import start_wx_application
  File "/usr/lib/python2.7/site-packages/timelinelib/wxgui/setup.py", line 27, in <module>
    from timelinelib.wxgui.dialogs.mainframe import MainFrame
  File "/usr/lib/python2.7/site-packages/timelinelib/wxgui/dialogs/mainframe.py", line 43, in <module>
    from timelinelib.wxgui.components.timeline import TimelinePanel
  File "/usr/lib/python2.7/site-packages/timelinelib/wxgui/components/timeline.py", line 22, in <module>
    from timelinelib.view.drawingarea import TimelineCanvasController
  File "/usr/lib/python2.7/site-packages/timelinelib/view/drawingarea.py", line 23, in <module>
    from timelinelib.features.experimental.experimentalfeatures import EVENT_DONE
  File "/usr/lib/python2.7/site-packages/timelinelib/features/experimental/experimentalfeatures.py", line 46, in <module>
    LOCALE_DATE = ExperimentalFeatureDateFormatting()
  File "/usr/lib/python2.7/site-packages/timelinelib/features/experimental/experimentalfeaturedateformatting.py", line 43, in __init__
    self._construct_format(dt)
  File "/usr/lib/python2.7/site-packages/timelinelib/features/experimental/experimentalfeaturedateformatting.py", line 88, in _construct_format
    self._field_positions = self._get_field_positions(dt)
  File "/usr/lib/python2.7/site-packages/timelinelib/features/experimental/experimentalfeaturedateformatting.py", line 96, in _get_field_positions
    return {keys[0]: 0, keys[1]: 1, keys[2]: 2}
IndexError: list index out of range

Local variables in innermost frame:
keys: ['3333', '\xb9\xb411\xe6\x9c\x8822\xe6\x97\xa5']
dt: '3333\xe5\xb9\xb411\xe6\x9c\x8822\xe6\x97\xa5'
self: <timelinelib.features.experimental.experimentalfeaturedateformatting.ExperimentalFeatureDateFormatting object at 0x7f6d8b696850>

Comment 1 Tong Hui 2015-09-14 08:12:06 UTC
Created attachment 1073123 [details]
File: backtrace

Comment 2 Tong Hui 2015-09-14 08:12:07 UTC
Created attachment 1073124 [details]
File: environ

Comment 3 Rickard Lindberg 2015-12-04 11:53:04 UTC
I have confirmed that this bug is still present in the latest commit.

Here is how to reproduce it:

$ hg clean && LANG=zh_CN ./source/timeline.py -c non-existing.cfg :tutorial:
...
omitted lines
...
  File "./source/timelinelib/features/experimental/experimentalfeaturedateformatting.py", line 98, in _get_field_positions
    return {keys[0]: 0, keys[1]: 1, keys[2]: 2}
IndexError: list index out of range

In other words, it looks like the Chinese locale/date format is not handled correctly.

Comment 4 Rickard Lindberg 2015-12-04 12:26:55 UTC
Print of df variable:

>>> x='3333\xe5\xb9\xb411\xe6\x9c\x8822\xe6\x97\xa5'
>>> print(x)
3333年11月22日

Comment 5 Rickard Lindberg 2015-12-04 12:28:03 UTC
(In reply to Rickard Lindberg from comment #4)
> Print of df variable:

dt that is.

Comment 6 Fedora Update System 2015-12-07 06:44:06 UTC
timeline-1.5.1-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-b16dfe795a

Comment 7 Rickard Lindberg 2015-12-07 06:53:56 UTC
I've fixed the problem in 1.5.1. The next upcoming release (1.9.0) will also contain the fix.

Comment 8 Fedora Update System 2015-12-07 23:21:54 UTC
timeline-1.5.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update timeline'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-b16dfe795a

Comment 9 Fedora Update System 2015-12-17 08:52:47 UTC
timeline-1.5.1-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.