Discussion:
lyx2lyx bug reported to fedora: lyx_2_1.py:4356:convert_chunks:IndexError: list index out of range
José Matos
2014-05-26 21:27:02 UTC
Permalink
Hi,
we got a bug reported at Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1098368

related with chunks conversions.

According to git blame, Richard and JÃŒrgen were the last to touch this code. :-)


The problem according to my analysis is the line

lastpar = ''.join(contents[-1])

where contents is an empty list.


So probably something like

if not contents: continue

would work.


The next question is if it is possible to have such a legal lyx file?

Regards,
--
José Abílio
Patrick O'Keeffe
2014-05-27 05:33:49 UTC
Permalink
Post by José Matos
The problem according to my analysis is the line
lastpar = ''.join(contents[-1])
where contents is an empty list.
So probably something like
if not contents: continue
would work.
A more precise fix may be preferred:

lastpar = ''.join(contents[-1] if contents else [])

Whether or not contents could ever be empty is a good question though.

Patrick
Richard Heck
2014-05-27 13:07:29 UTC
Permalink
Post by Patrick O'Keeffe
Post by José Matos
The problem according to my analysis is the line
lastpar = ''.join(contents[-1])
where contents is an empty list.
So probably something like
if not contents: continue
would work.
lastpar = ''.join(contents[-1] if contents else [])
Whether or not contents could ever be empty is a good question though.
I expect we were just overlooking this possibility, so I'd add some such
fix and forget it.
Issue a warning if need be.

Richard

Loading...