[ python-Bugs-1541642 ] Compiler command percent-sign causes format string error

SourceForge.net noreply at sourceforge.net
Thu Aug 17 01:39:59 CEST 2006


Bugs item #1541642, was opened at 2006-08-16 18:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1541642&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Cowles (mdcowles)
Assigned to: Nobody/Anonymous (nobody)
Summary: Compiler command percent-sign causes format string error

Initial Comment:
[From a question posted to python-help]

Using Sun's compiler, distutils generates a command line with a 
percent-sign in it:

cc -DNDEBUG -xO3 -xtarget=native -xbuiltin=%all -xdepend=yes -
xlibmil -xlibmopt -xstrconst -Xa -I/opt/pkg/include/db4 -I/usr/
include -I/opt/pkg/include -xcode=pic32 -OPT:Olimit=0 -I. -I/opt/
pkg.obj/lang/python24/work.e450/Python-2.4.3/./Include -I/opt/
pkg/include -I/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/
Include -I/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3 -c /
opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Modules/
structmodule.c -o build/temp.solaris-2.10-sun4u-2.4/structmodule.o

It seems that the percent-sign in "-xbuiltin=%all" isn't escaped when 
distutils goes to print the line and a format string error occurs:

File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/log.py", line 23, in _log
    print msg % args
TypeError: not enough arguments for format string
*** Error code 1

Here's the full traceback:

running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building 'struct' extension
Traceback (most recent call last):
  File "./setup.py", line 1105, in ?
    main()
  File "./setup.py", line 1099, in main
    scripts = ['Tools/scripts/pydoc2.4',
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/command/build_ext.py", line 279, in run
    self.build_extensions()
  File "./setup.py", line 179, in build_extensions
    build_ext.build_extensions(self)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/command/build_ext.py", line 405, in build_extensions
    self.build_extension(ext)
  File "./setup.py", line 184, in build_extension
    build_ext.build_extension(self, ext)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/command/build_ext.py", line 470, in build_extension
    depends=ext.depends)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/ccompiler.py", line 699, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/unixccompiler.py", line 112, in _compile
    self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/ccompiler.py", line 1040, in spawn
    spawn (cmd, dry_run=self.dry_run)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/spawn.py", line 37, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/spawn.py", line 122, in _spawn_posix
    log.info(string.join(cmd, ' '))
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/log.py", line 33, in info
    self._log(INFO, msg, args)
  File "/opt/pkg.obj/lang/python24/work.e450/Python-2.4.3/Lib/
distutils/log.py", line 23, in _log
    print msg % args
TypeError: not enough arguments for format string
*** Error code 1


(I'm posting this for the person who originally ran into the error and 
asked about it on python-help.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1541642&group_id=5470


More information about the Python-bugs-list mailing list