[Python-modules-team] Bug#500814: /usr/share/pyshared/scipy/weave/build_tools.py: weave fails to restore sys.argv if compilation fails
Yaroslav Halchenko
debian at onerussian.com
Wed Oct 1 17:11:47 UTC 2008
Package: python-scipy
Version: 0.6.0-12
Severity: normal
File: /usr/share/pyshared/scipy/weave/build_tools.py
Tags: patch
in the file
/usr/share/pyshared/scipy/weave/build_tools.py
logic is as follows:
configure_sys_argv(compiler_name,temp_dir,build_dir)
# the business end of the function
try:
.....
except SyntaxError: #TypeError:
success = 0
# restore argv after our trick...
restore_sys_argv()
so if compilation fails, argv are not restored, and all kinds of side-effects can occur (in our case unittesting was hurt badly).
tentative fix is to restore argv on any exception prior to reraising
it... smth like:
configure_sys_argv(compiler_name,temp_dir,build_dir)
# the business end of the function
try:
.....
except SyntaxError: #TypeError:
success = 0
except Exception, e:
restore_sys_argv()
raise e
# restore argv after our trick...
restore_sys_argv()
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (991, 'testing'), (990, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-scipy depends on:
ii libatlas3gf-base [liblapack.s 3.6.0-21.5 Automatically Tuned Linear Algebra
ii libatlas3gf-sse2 [liblapack.s 3.6.0-21.5 Automatically Tuned Linear Algebra
ii libblas3gf [libblas.so.3gf] 1.2-1.5 Basic Linear Algebra Subroutines 3
ii libc6 2.7-11 GNU C Library: Shared libraries
ii libfftw3-3 3.1.2-3 library for computing Fast Fourier
ii libgcc1 1:4.3.1-9 GCC support library
ii libgfortran3 4.3.1-9 Runtime library for GNU Fortran ap
ii liblapack3gf [liblapack.so.3g 3.1.1-0.4 library of linear algebra routines
ii libstdc++6 4.3.1-9 The GNU Standard C++ Library v3
ii libsuitesparse-3.1.0 3.1.0-3 collection of libraries for comput
ii python 2.5.2-1 An interactive high-level object-o
ii python-central 0.6.7 register and build utility for Pyt
ii python-imaging 1.1.6-2 Python Imaging Library
ii python-numpy 1:1.1.0-3 Numerical Python adds a fast array
Versions of packages python-scipy recommends:
ii g++ [c++-compiler] 4:4.3.1-2 The GNU C++ compiler
ii g++-2.95 [c++-compiler] 1:2.95.4-27 The GNU C++ compiler
ii g++-3.2 [c++-compiler] 1:3.2.3-9 The GNU C++ compiler
ii g++-3.3 [c++-compiler] 1:3.3.6-15 The GNU C++ compiler
ii g++-4.0 [c++-compiler] 4.0.3-7 The GNU C++ compiler
ii g++-4.1 [c++-compiler] 4.1.2-22 The GNU C++ compiler
ii g++-4.2 [c++-compiler] 4.2.3-5 The GNU C++ compiler
ii g++-4.3 [c++-compiler] 4.3.1-9 The GNU C++ compiler
-- no debconf information
More information about the Python-modules-team
mailing list