[luatex] Strange behavior for io.popen

Br. Samuel Springuel rpspringuel at gmail.com
Tue Jun 6 21:02:42 CEST 2017

In working with the TeXLive 2017 pretest, we (the Gregorio developers) 
came across what appears to be a bug in io.popen: it's passing the 
statement `all commands are permitted` to the sh instance that it was 
creating, resulting in an `all: command not found` error.  After some 
considerable testing (see conversation here: 
https://github.com/gregorio-project/gregorio/issues/1362), we isolated 
the problem to the `--shell-escape` switch.  If the simple document 
below is compiled *without* the switch, it is behaves as expected and is 
able to retrieve the gregorio version number (gregorio is on the list of 
commands permitted without shell-escape in texmf.cnf for TeXLive 2017). 
When compiled with the switch, however, the error crops up and the 
document reads `l is nil`.

     f = io.popen('gregorio --version', 'r')
     if f then
         l = f:read('*l')
         if l then
             tex.print('got '..l)
             tex.print('l is nil')
         tex.print('f is nil')

Besides the original Ubuntu 16.04 system this was seen on, we've also 
been able to confirm it on Gentoo, Mac 10.10 (Yosemite), and Windows 10 
and so believe the problem to be platform independent.

Br. Samuel, OSB
St. Anselm’s Abbey
Washington, DC
(R. Padraic Springuel)


More information about the luatex mailing list