lyx2lyx error: IndexError: list index out of range

Scott Kostyshak scott.kostyshak at gmail.com
Mon Dec 19 21:57:26 UTC 2022


On Sun, Dec 11, 2022 at 09:42:33PM +0000, José Matos wrote:
> On Sun, 2022-12-11 at 15:29 -0500, Scott Kostyshak wrote:
> > convert_hebrew_parentheses
> >     elif current_languages[-1] == 'hebrew' and not
> > line.startswith('\\'):
> > IndexError: list index out of range
> 
> This happens only when current_languages is an empty list:
> 
> In [1]: [][-1]
> -----------------------------------------------------------------------
> IndexError                            Traceback (most recent call last)
> Cell In [1], line 1
> ----> 1 [][-1]
> 
> IndexError: list index out of range

The problem is that the code is supposed to append, then pop. then
append, then pop. There is a mismatch somewhere and the code pops
without a preceding append, so the list of languages is empty.

Scott


More information about the lyx-devel mailing list