scons assumes all elements of sys.argv are != ""

Bug #338492 reported by Simon Dierl
2
Affects Status Importance Assigned to Milestone
SCons
Fix Released
High
scons (Ubuntu)
Fix Released
Low
Luca Falavigna

Bug Description

Binary package hint: scons

Ubuntu 8.10
scons 0.98.5-1ubuntu1

It is possible to call SCons and pass an empty element as part of sys.argv (python example):
cd /path/to/sources-using-scons/
python
>>> import subprocess
>>> subprocess.Popen(("scons", ""))

SCons' hand-written parser for the command line now assumes that all elements of sys.argv are != "", resulting in:
IndexError: string index out of range:
  File "/usr/lib/scons/SCons/Script/Main.py", line 1248:
    _exec_main(parser, values)
  File "/usr/lib/scons/SCons/Script/Main.py", line 1213:
    _main(parser)
  File "/usr/lib/scons/SCons/Script/Main.py", line 859:
    if a[0] == '-':

Tested with the Battle for Wesnoth trunk SVN sources (although the bug should be reproducible with all sources using a SCons build system). Note that you need some sources to reproduce the bug, otherwise, SCons just complains about the lack of SConscript etc. and quits.

Related branches

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Thank you for your bug report.
Confirmed in Jaunty too with 1.2.0-1.

Changed in scons:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → dktrkranz
Changed in scons:
status: Unknown → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package scons - 1.2.0-1ubuntu1

---------------
scons (1.2.0-1ubuntu1) jaunty; urgency=low

  * debian/rules: make SCons ready for Python 2.6:
    - Include /usr/share/python/python.mk.
    - Pass $(py_setup_install_args) macro to setup.py install.
  * debian/patches/no_commandline_arguments (LP: #338492):
    - Fix an exception when a null command-line argument is passed in.

 -- Luca Falavigna <email address hidden> Fri, 06 Mar 2009 08:25:10 +0000

Changed in scons:
status: Triaged → Fix Released
Changed in scons:
status: Confirmed → Fix Released
Changed in scons:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.