bug in sh() functionality

15 views
Skip to first unread message

Drew

unread,
Oct 15, 2009, 2:10:18 AM10/15/09
to paver
Somehow the string interpolation needs to be turned off -

from paver.easy import *
sh("echo %foobar")

produces

Traceback (most recent call last):
File "/home/drw900/venvs/mypy/bin/paver", line 8, in <module>
load_entry_point('Paver==1.0.1', 'console_scripts', 'paver')()
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/tasks.py", line 615, in main
_launch_pavement(args)
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/tasks.py", line 595, in _launch_pavement
execfile(environment.pavement_file, mod.__dict__)
File "pavement.py", line 2, in <module>
sh("echo %foobar")
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/easy.py", line 55, in sh
return dry(command, runpipe)
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/easy.py", line 13, in dry
info(message)
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/easy.py", line 25, in info
tasks.environment.info(message, *args)
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/tasks.py", line 45, in info
self._log(2, message, args)
File "/home/drw900/venvs/mypy/lib/python2.6/site-packages/
Paver-1.0.1-py2.6.egg/paver/tasks.py", line 54, in _log
output = message % args
TypeError: not enough arguments for format string


-Drew

Doug Hellmann

unread,
Oct 15, 2009, 9:53:25 AM10/15/09
to pa...@googlegroups.com

On Oct 15, 2009, at 2:10 AM, Drew wrote:

>
> Somehow the string interpolation needs to be turned off -
>
> from paver.easy import *
> sh("echo %foobar")

Use double "%":

sh("echo %%foobar")

Doug

Damien Lebrun

unread,
Oct 15, 2009, 11:42:44 AM10/15/09
to pa...@googlegroups.com
The problem is with logging the command line. With double "%" the
logger display 'echo %foobar') but sh() execute "echo %%foobar":

>>> from paver.easy import *
>>> sh('echo %%foo')
echo %foo
%%foo

dinoboff

unread,
Oct 15, 2009, 11:49:31 AM10/15/09
to paver

It might be fixed in the trunk:

http://code.google.com/p/paver/issues/detail?id=38

Adam Lowry

unread,
Oct 15, 2009, 1:15:06 PM10/15/09
to paver
On Oct 15, 8:49 am, dinoboff <dinob...@googlemail.com> wrote:
> It might be fixed in the trunk:
>
> http://code.google.com/p/paver/issues/detail?id=38

I just tried it, and it is indeed fixed in trunk, along with similar
troubles when using debug() and info() that I've had in the past.

Kevin Dangoor

unread,
Oct 16, 2009, 8:16:35 AM10/16/09
to pa...@googlegroups.com

And given that it was fixed sometime back, it looks like it's time for a release! I'll have to see if there are some more outstanding patches and then make a release...

Kevin



--
Kevin Dangoor

work: http://labs.mozilla.com/
email: k...@blazingthings.com
blog: http://www.BlueSkyOnMars.com
Reply all
Reply to author
Forward
0 new messages