Bug#857491: Computation of top_dir is fooled by README

Steve M. Robbins smr at debian.org
Sat Mar 11 21:33:51 UTC 2017


Package: python-sfepy
Version: 2016.2-2
Severity: normal

I tried to run the examples using:

  sfepy-run simple examples/diffusion/poisson_short_syntax.py

and obtained:

  sfepy: left over: ['verbose', '__builtins__', '__file__', '__doc__', '__name__', 'data_dir', '__package__', '_filename']
  sfepy: reading mesh [line2, tri3, quad4, tetra4, hexa8] (/usr/lib/python2.7/dist-packages/meshes/3d/cylinder.mesh)...

... which fails because the mesh path is wrong.  There needs to be a sfepy after dist-packages.


The root cause of this is the computation of "top_dir" in version.py:

    # If installed, up_dir is '.', otherwise (in (git) source directory) '..'.
    for up_dir in ['..', '.']:
        top_dir = op.normpath(op.realpath(op.join(op.dirname(__file__),
                                                  up_dir)))
        aux = op.join(top_dir, 'README')
        if op.isfile(aux):
            break
    else:
        raise RuntimeError('cannot determine SfePy top level directory!')

The trouble is that ".." is tried first and there happens to be a README file
at that path: /usr/lib/python2.7/dist-packages/README !

There's an obvious Debian-only fix to remove '..' in version.py, which is
what I've done locally for now.




-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

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

Versions of packages python-sfepy depends on:
ii  ipython                           5.1.0-3
ii  libc6                             2.24-9
ii  libsuitesparse-dev                1:4.5.4-1
ii  mayavi2                           4.5.0-1
ii  python                            2.7.13-2
ii  python-matplotlib                 2.0.0+dfsg1-2
ii  python-numpy [python-numpy-abi9]  1:1.12.0-2
ii  python-pyparsing                  2.1.10+dfsg1-1
ii  python-scipy                      0.18.1-2
ii  python-sparse                     1.1.1-1
ii  python-tables                     3.3.0-5
pn  python:any                        <none>

python-sfepy recommends no packages.

python-sfepy suggests no packages.

-- no debconf information



More information about the debian-science-maintainers mailing list