Package: rubber
Version: 1.2-1
Severity: important
Tags: patch

Since one of the last two updates, rubber is unable to compile a document of
mine which previously it was perfectly able to:

pietro@debiousci:~/radiation$ rubber --inplace --maxerr -1 --short --force
--warn all --pdf radiation_04.tex
compiling radiation_04.tex...
running BibTeX on radiation_04...
Traceback (most recent call last):
  File "/usr/bin/rubber", line 4, in <module>
    sys.exit(Main()(sys.argv[1:]))
  File "/usr/lib/python2.7/dist-packages/rubber/cmdline.py", line 331, in
__call__
    return self.main(cmdline)
  File "/usr/lib/python2.7/dist-packages/rubber/cmdline.py", line 287, in main
    ret = env.main.make(True)
  File "/usr/lib/python2.7/dist-packages/rubber/depend.py", line 164, in make
    ok = self.force_run()
  File "/usr/lib/python2.7/dist-packages/rubber/converters/latex.py", line
1288, in force_run
    return self.run(True)
  File "/usr/lib/python2.7/dist-packages/rubber/converters/latex.py", line
1310, in run
    if not self.post_compile():
  File "/usr/lib/python2.7/dist-packages/rubber/converters/latex.py", line
1261, in post_compile
    if not mod.post_compile():
  File "/usr/lib/python2.7/dist-packages/rubber/converters/latex.py", line
1526, in post_compile
    return self.pymodule.post_compile()
  File "/usr/lib/python2.7/dist-packages/rubber/latex_modules/bibtex.py", line
421, in post_compile
    return biblio.post_compile()
  File "/usr/lib/python2.7/dist-packages/rubber/latex_modules/bibtex.py", line
235, in post_compile
    return self.run()
  File "/usr/lib/python2.7/dist-packages/rubber/latex_modules/bibtex.py", line
258, in run
    if self.doc.env.execute(['bibtex', basename], doc, pwd=workdir):
  File "/usr/lib/python2.7/dist-packages/rubber/environment.py", line 228, in
execute
    stderr = stderr)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory: ''

The problem is that "execute()" in "environment.py" is receiving the empty
string as "pwd" argument, and this in turn is due to "run()", in
latex_modules/bibtex.py, calling "os.path.dirname" on a string which contains
(at least in some cases) a filename rather than a full path.

The problem is solved by replacing

                workdir = os.path.dirname (self.base)

with

                workdir = os.path.dirname(os.path.realpath(self.base))

at line 256 of latex_modules/bibtex.py. I am farly confident this fix should
not have undesired effects, what I ignore is whether it would better be
implemented at some other level (i.e. if other modules than bibtex are affected
by this bug).



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (650, 'testing'), (600, 'unstable'), (600, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=it_IT.utf8, LC_CTYPE=it_IT.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages rubber depends on:
ii  python              2.7.9-1
pn  python:any          <none>
ii  texlive-latex-base  2015.20150823-1

rubber recommends no packages.

Versions of packages rubber suggests:
ii  imagemagick  8:6.8.9.9-5
pn  sam2p        <none>
pn  transfig     <none>

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/lib/python2.7/dist-packages/rubber/environment.py 
(from rubber package)
debsums: changed file 
/usr/lib/python2.7/dist-packages/rubber/latex_modules/bibtex.py (from rubber 
package)

Reply via email to