Patches for Python scripts

Thibaut Cuvelier tcuvelier at
Fri Jan 29 22:40:29 UTC 2021

I will be answering most concerns here, in no particular order. I think it
will simplify the next messages.

- This is far from an overhaul of the script. The logic did not really
change, neither the code structure. I have ideas on how to do it, and I
could do it if you are OK with it, but I completely agree that larger
changes should be delayed to the next version (or 2.4 should be delayed by
a few months). This should also be the occasion to get rid of Python 2
completely, that would make the code much clearer.

- The cosmetic changes are based on PEP8, which is the only style guide for
Python. Highly similar patches already went into the code base less than a
year ago (
Other style guides for Python are just more precise than PEP8 (e.g.,
Google: I have yet to see an
important open-source project that does not use PEP8 style guide. It's as
unopiniated as opinion could get on Python.
For now, the Python scripts follow the WTF style guide: every committer
does what they prefer, without any kind of consistency. Python is very
different from other languages in that there is a real consensus in the
community on one style guide (PHP is going in the same direction, but it's
not yet as commonly used: I am not
proposing one style guide for C++ or Perl code, for instance.

- This way to find Java is quite common on Windows platforms (actually,
it's a lot like a port of JavaCall.jl's relevant portion of code: It looks like Oracle's JVM
does the same at installation:
Other JVMs mimic the same behaviour:
Moreover, I don't think we can let beginner users on their own to configure
the PATH, we really should go an extra step to find a Java binary (while
letting the PATH have preference over anything else, so that users can
still choose which Java they want).
Using things like \HKEY_CLASSES_ROOT\Installer\Products\ is, in my opinion,
the wrong way to check for Java in the registry: these identifiers seem to
vary a lot between versions of Java (
On my machine, I have no 4EA42A62D9304AC4784BF2238120180F, for instance.
I am attaching a new version of the patch based on
Does it work for you? Otherwise, would you have something else under

On Fri, 29 Jan 2021 at 14:41, Kornel Benko <kornel at> wrote:

> Am Fri, 29 Jan 2021 13:39:19 +0100
> schrieb Pavel Sanda <sanda at>:
> > On Fri, Jan 29, 2021 at 11:07:43AM +0000, José Abílio Matos wrote:
> > > With the extent of the patches I fear that there could be bugs
> (unintended
> > > changes) lurking specially in relation to python 2.
> >
> > Riki's call, but I don't think this is the best time for python scripts
> overhaul.
> > Except the changes fixing real bugs we should IMHO postpone these to
> post 2.4 world.
> >
> > Pavel
> +1
>         Kornel
> --
> lyx-devel mailing list
> lyx-devel at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0013-Configure-look-for-Java-in-the-registry-on-Windows.patch
Type: application/octet-stream
Size: 2722 bytes
Desc: not available
URL: <>

More information about the lyx-devel mailing list