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


Groups > comp.lang.python > #103055 > unrolled thread

Re: TypeError: not all arguments converted during string formatting

Started byChris Angelico <rosuav@gmail.com>
First post2016-02-18 01:02 +1100
Last post2016-02-18 01:02 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: TypeError: not all arguments converted during string formatting Chris Angelico <rosuav@gmail.com> - 2016-02-18 01:02 +1100

#103055 — Re: TypeError: not all arguments converted during string formatting

FromChris Angelico <rosuav@gmail.com>
Date2016-02-18 01:02 +1100
SubjectRe: TypeError: not all arguments converted during string formatting
Message-ID<mailman.211.1455717723.22075.python-list@python.org>
On Thu, Feb 18, 2016 at 12:58 AM, Ganesh Pal <ganesh1pal@gmail.com> wrote:
> 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
>

The print statement/function happily accepts multiple arguments, and
will join them according to a set of predefined rules. The logging
functions don't have those rules, so they take one message and some
optional parameters. Try this, instead:

logging.info("%r %r %r", out, err, ret)

and then tweak the format string according to requirements. For a
quick dump, this will serve you well.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web