Bug 1262726 - [abrt] timeline: experimentalfeaturedateformatting.py:96:_get_field_positions:IndexError: list index out of range
Summary: [abrt] timeline: experimentalfeaturedateformatting.py:96:_get_field_positions...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: timeline
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:d3f23d4cdc2f6b864e0ed5a4e19...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-14 08:12 UTC by Tong Hui
Modified: 2015-12-17 08:52 UTC (History)
2 users (show)

Fixed In Version: timeline-1.5.1-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-17 08:52:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.93 KB, text/plain)
2015-09-14 08:12 UTC, Tong Hui
no flags Details
File: environ (341 bytes, text/plain)
2015-09-14 08:12 UTC, Tong Hui
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.