listerrors fails

Kornel Benko kornel at lyx.org
Mon Sep 28 10:40:17 UTC 2020


Am Mon, 28 Sep 2020 11:16:33 +0100
schrieb José Abílio Matos <jamatos at lyx.org>:

> On Monday, September 28, 2020 8:51:40 AM WEST Kornel Benko wrote:
> > Our python script lib/scripts/listerrors fails with the message
> >   File "./listerrors", line 25
> >     from __future__ import print_function
> >     ^
> > SyntaxError: from __future__ imports must occur at the beginning of the file
> > Exit 1
> > 
> > Since we require python3 here, this line is not needed IMHO
> 
> We do not, at least not for 2.4.
> 
> The reason why we have the shebang as
> #!/usr/bin/python3
> 
> is that if we want to run the script alone we can do it using that binary. 
> That is useful for testing only.
> 
> AFAIR all the scripts are called from lyx using the chosen python version.
> 
> > Removing this line, and using on the make-log I get
> > Traceback (most recent call last):
> >   File "lib/scripts/listerrors", line 162, in <module>
> >     main()
> >   File "lib/scripts/listerrors", line 70, in main
> >     if predicate(line): break
> >   File "lib/scripts/listerrors", line 77, in noweb_try
> >     if string.find(line, ": unescaped << in documentation chunk") != -1:
> > AttributeError: module 'string' has no attribute 'find'
> 
> This is a script that has been almost untouched and so it still has these nice 
> memories. In particular the methods like find and others are available as 
> strings (the objects not the module) since python 2.0 released in 16 October 
> 2000.
> 
> The module methods were removed in python 3 since they were redundant.
> 
> > (master & branch 2.3.x)
> > 
> > 	Kornel
> 

Thanks José,
at least it does not crash. Since there were no errors in the log, I cannot be sure
if the script would find any.

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200928/6d627061/attachment.asc>


More information about the lyx-devel mailing list