José Matos 58734edff6 Make the lyx2lyx code compatible between python2 and python3.
FWIW this code is important for very old versions of lyx, older than 1.1.5 (released 19 years ago - 2000/06/06).

Funny fact of the day, byte strings do not behave as regular strings in python3 when taking and index.
To get a sub-string we need to pass a range, a integer index will not work as it happens in a regular string:

$ ipython3
...
In [30]: line
Out[30]: b'#This file was created by <mike> Tue Jan 25 10:36:51 2000'

In [31]: line[0]
Out[31]: 35

In [32]: line[0:1]
Out[32]: b'#'

The range notations works for both byte and regular strings in python 3, and it also works in python 2.
Thus the change is simple and effective. In any case I should confess that I was quite surprised by this. :-)
2019-06-05 14:06:09 +01:00
..
2011-04-02 11:00:19 +00:00
2019-06-04 11:01:19 +02:00
2019-06-04 18:26:13 +01:00
2011-02-21 19:56:43 +00:00
2019-05-31 18:29:30 +02:00
2019-03-29 11:55:20 +01:00
2019-04-07 11:05:42 +02:00
2019-06-03 10:53:49 +02:00
2019-06-05 11:18:36 +02:00
2019-05-16 21:21:53 +02:00
2018-03-09 15:17:23 +01:00