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
..
2017-10-16 10:03:05 +02:00
2018-01-31 21:13:43 +01:00
2019-03-10 13:00:10 +01:00
2019-03-10 13:00:10 +01:00
2019-03-10 13:00:10 +01:00
2019-06-04 11:01:19 +02:00
2018-02-23 08:58:16 +01:00
2019-06-02 00:04:34 +02:00
2018-01-31 21:13:43 +01:00