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

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ganesh Pal <ganesh1pal@gmail.com>
Newsgroups comp.lang.python
Subject Re: TypeError: not all arguments converted during string formatting
Date Wed, 17 Feb 2016 19:30:20 +0530
Lines 39
Message-ID <mailman.210.1455717622.22075.python-list@python.org> (permalink)
References <CACT3xuX36xwQUZ=KWoxVzyNzsmnt_UM3==j0zgDH5UNTGR7HxQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de GW0bQkptkvdCF7S+4NVA/wWZE24WfLVmEa5cwyt5CaeQ==
Return-Path <ganesh1pal@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'formatting': 0.07; 'subject:string': 0.09; 'typeerror:': 0.09; 'python': 0.10; 'subject:not': 0.11; 'exception': 0.13; 'wed,': 0.15; '(pdb)': 0.16; '2016': 0.16; 'e))': 0.16; 'emit': 0.16; 'err': 0.16; 'err,': 0.16; 'failed")': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'string': 0.17; 'try:': 0.18; 'team,': 0.18; 'skip:" 40': 0.20; 'to:name:python- list@python.org': 0.20; '%s"': 0.22; 'arguments': 0.22; 'converted': 0.22; 'feb': 0.23; '(most': 0.24; 'header:In-Reply- To:1': 0.24; 'linux': 0.26; 'error': 0.27; 'message- id:@mail.gmail.com': 0.27; '2.6': 0.27; 'ret': 0.29; 'raise': 0.29; 'print': 0.30; 'code': 0.30; 'subject:all': 0.32; 'getting': 0.33; 'run': 0.33; 'problem': 0.33; 'traceback': 0.33; 'file': 0.34; 'except': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'replaced': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'suggestion': 0.37; 'received:209': 0.38; 'format': 0.39; 'skip:e 20': 0.39; 'to:addr:python.org': 0.40
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Cl7ePowS04ZnykdC8oeVyxTkn0rixWZLJHM3cXaT1xE=; b=cwwyoWJJxCXD0gHS18t5t+8/ZjpHqQ9XCE/9rcosGMQrGOn21ytUE2aGH+4pEY7Oy9 M65YIOA2ifWDg4kXtcXo6gIs/7Ep5kCducpgrP0+6+JeqgS9a2/TegdBURAeCaDXc3zA Uw1CMuYpMMjtr+2LxZNKJJunt0zjAVpCHR0Wid3OQVBU4lU47SYccXObJ8mpNkWYUapl Zha8hA3B40SAfNpsxubWorprDpldNRmvNMb/VmpEiMZt8ez74ufe8K5OhHIskgGpvmPR VYWc5/7SUPKWAlVQ9QB89j5RwWg9icpWFwVCx2J2TgfgTFG184EfhGr0y+Q2Rtuvzcx4 yMyA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Cl7ePowS04ZnykdC8oeVyxTkn0rixWZLJHM3cXaT1xE=; b=VhZBkSo4f8e21EWHraem4JiWYuwcmui+xXtoxT53tVPyND2ZSJHVjFJ8pVff4Go/OT Lajhm3oIvLLvPH6EwHUxJjvQskfXSXnUUhQdrRwoa2TweqUdTbwPnwSXlx5nlOJF/QHZ DGAETJcdm3aekjuvkFQojEYtzVd/kuMnzMUu8WqIKSD45FVLNsJFb6TOCZ2UD+lcV0G1 RUVkWWwCfydJBaGCI68+eFG9MsI6UNbZMcCCYb3QMRBrTD1P+QMIdKTSiRA3AgY5rryc IUmc4xV53UIHcm6r1a7f9GxknDp4mXPrWxsY8oNjlR/eJmJneSzmhgyw7ZMipw3we/4G X5uQ==
X-Gm-Message-State AG10YOQGSene9mxw3jxBozJItseW+B2LZbylYgduyC02Q8TVWPJppqNHjHRR6amPYUAVTm+mmLg28Y02HwL4QA==
X-Received by 10.25.127.208 with SMTP id a199mr688002lfd.149.1455717620426; Wed, 17 Feb 2016 06:00:20 -0800 (PST)
In-Reply-To <CACT3xuX36xwQUZ=KWoxVzyNzsmnt_UM3==j0zgDH5UNTGR7HxQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21rc2
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:103054

Show key headers only | 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