TypeError: not all arguments converted during string formatting

Ganesh Pal ganesh1pal at gmail.com
Wed Feb 17 09:00:20 EST 2016


I think  logging.info(out) works the problem is when I add
logging.info(out,err,ret) ,may be there is a better way to supply this
arguments

On Wed, Feb 17, 2016 at 7:28 PM, Ganesh Pal <ganesh1pal at gmail.com> wrote:
> Hi Team,
>
>
> Iam on python 2.6 and Linux  ,  I had replaced print out, err ret with
>   logging.info(out, err ,ret)   in the below code . I am getting
>
> "TypeError: not all arguments converted during string formatting"
> error any quick suggestion
>
>
> try:
>             out, err, ret = run(cmd, timeout=60)
>             # New line added below
>             logging.info(out, err ,ret)
>             if ret != 0:
>                 logging.error("Can't run %s got %s (%d)!" % (cmd, err, ret))
>                 raise Exception("Preparing cluster failed...Exiting !!!")
>         except Exception as e:
>             logging.exception("Failed to run %s got %s" % (cmd, e))
>             sys.exit("Preparing cluster failed")
>     logging.info("Preparing Cluster.....Done !!!")
>
>
> (Pdb) c
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.6/logging/__init__.py", line 755, in emit
>   File "/usr/local/lib/python2.6/logging/__init__.py", line 637, in format
>   File "/usr/local/lib/python2.6/logging/__init__.py", line 425, in format
>   File "/usr/local/lib/python2.6/logging/__init__.py", line 295, in getMessage
> TypeError: not all arguments converted during string formatting
>
>
> Regards,
> Ganesh


More information about the Python-list mailing list