]> git.lyx.org Git - features.git/commit
Make lyx_pot.py python3 compatible
authorGeorg Baum <baum@lyx.org>
Fri, 25 Mar 2016 09:24:46 +0000 (10:24 +0100)
committerGeorg Baum <baum@lyx.org>
Fri, 25 Mar 2016 09:24:46 +0000 (10:24 +0100)
commit262ae8264abe38dea41bff6e384e27cffc76bd3b
tree4291bd49805f982a961f93aa952ac553d0641874
parent0aaa930a5c1d400e69082eb60ccac47cc88f9859
Make lyx_pot.py python3 compatible

Now it produces the same output if running under python3 (tested with 3.4.2)
or python2 (tested with 2.7.9). python3 always uses unicode strings
internally, so we have to specify the file encoding on opening a file, such
that strings can be converted from and to the file encoding on reading and
writing. Using the io module for file io ensures that the behaviour is the
same for python2 and python3. For python2 we also have to mark string literals
as unicode strings by using the u prefix (which is a noop in python3).

Many thanks to José for review and pointing out all the details.
po/lyx_pot.py