Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103054

Re: TypeError: not all arguments converted during string formatting

From Ganesh Pal <ganesh1pal@gmail.com>
Newsgroups comp.lang.python
Subject Re: TypeError: not all arguments converted during string formatting
Date 2016-02-17 19:30 +0530
Message-ID <mailman.210.1455717622.22075.python-list@python.org> (permalink)
References <CACT3xuX36xwQUZ=KWoxVzyNzsmnt_UM3==j0zgDH5UNTGR7HxQ@mail.gmail.com>

Show all headers | View raw


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@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: TypeError: not all arguments converted during string formatting Ganesh Pal <ganesh1pal@gmail.com> - 2016-02-17 19:30 +0530

csiph-web