Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100636
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) |
| Date | Mon, 21 Dec 2015 08:56:34 +1100 |
| Lines | 25 |
| Message-ID | <mailman.7.1450648598.2237.python-list@python.org> (permalink) |
| References | <mailman.4.1450632635.2237.python-list@python.org> <3883651.fOIMIIEhYO@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de w01FEwQLRKSv4HWlNR8iFgfteQY3NkZl3szuerwpjDfw== |
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'received:209.85.223': 0.03; '21,': 0.07; 'formatting': 0.07; 'cc:addr:python-list': 0.09; 'subject:How': 0.09; 'subject:ignore': 0.09; 'python': 0.10; 'subject:error': 0.11; 'subject: \n ': 0.15; 'cmd,': 0.16; 'err,': 0.16; 'formatting.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:non': 0.16; '{0};': 0.16; 'wrote:': 0.16; 'string': 0.17; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'minor': 0.22; 'am,': 0.23; 'dec': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; '2.6': 0.27; "skip:' 10": 0.28; 'skip:( 20': 0.28; 'away.': 0.29; 'another': 0.32; 'run': 0.33; 'url:python': 0.33; 'received:google.com': 0.35; "isn't": 0.35; 'should': 0.36; 'instead': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'format': 0.39; 'subject:-': 0.39; 'subject:with': 0.40; 'hang': 0.60; 'thomas': 0.63; 'oldest': 0.66; 'percent': 0.66; 'url:6': 0.66; '(why': 0.84; 'abandon': 0.84; 'chrisa': 0.84; 'subject:status': 0.84; 'to:none': 0.91; 'favour': 0.93; 'hand,': 0.97 |
| 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:cc :content-type:content-transfer-encoding; bh=H4ubtPn9vflP/jUi/7Tq9MYs2U4/4L4WwT9y5URUg4U=; b=C5Nl+7GogK8tjrCUpzH8yZpuNXGCQflnAwsjM9M8OtxIzFiQ+0ZfP4P/2dSCJtGnxh fsgBgqYnhgzxlhDFjMPMo8zsrgsZvwIsmiFqZBjL24vuPGuHC72usBXVvLk+datrvQkA Sn6R6KkY0Td1jP6mDDOFqB6+I2iHBwdFiE5dUhgTtD3v3OHrfGSO1jkFnTqQC38QJdbd RxadbyfxXSEAqzRhL4IeOktpwlRL2mymzDJUpcbf+JV0J1N9QoL0cKnhHmMQYbq88Yxo 8IyVqjw4ItnQL9eeRykEhqveAn12AsE84pWqNe5niC75H8d1PWi9YvKqvQ1fvzDx56ln mdnQ== |
| X-Received | by 10.107.163.146 with SMTP id m140mr14902634ioe.19.1450648594884; Sun, 20 Dec 2015 13:56:34 -0800 (PST) |
| In-Reply-To | <3883651.fOIMIIEhYO@PointedEars.de> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| 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:100636 |
Show key headers only | View raw
On Mon, Dec 21, 2015 at 8:22 AM, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:
> Python 2.6 (why are you using the oldest Python minor version?) introduced
> string.format(), so you should use that instead of the old string format
> operator (“%”):
>
> logging.error("Can't run {0}; got {1} ({2:d})!".format(cmd, err, ret))
>
> <https://docs.python.org/2.6/library/stdtypes.html#str.format>
Percent formatting isn't going away. There's no need to tell people to
abandon it in favour of .format(), unless they actually need a feature
of .format().
> On the other hand, you do not need the format operator to begin with:
>
> logging.error("Can't run %s; got %s (%d)!", cmd, err, ret)
>
> <https://docs.python.org/2.6/library/logging.html#logging.error>
>
See? Another good reason to hang onto percent formatting.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to ignore error with anon-zero exit status Ganesh Pal <ganesh1pal@gmail.com> - 2015-12-20 23:00 +0530
Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-20 22:22 +0100
Re: Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Chris Angelico <rosuav@gmail.com> - 2015-12-21 08:56 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-20 23:46 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-21 10:09 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 08:51 +0100
Re: Ignore error with non-zero exit status Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-21 12:58 +0000
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 14:19 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 00:23 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 15:05 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 01:11 +1100
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 15:19 +0100
Re: Ignore error with non-zero exit status Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-21 16:07 +0000
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:30 +0100
Re: Ignore error with non-zero exit status Random832 <random832@fastmail.com> - 2015-12-21 11:30 -0500
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:27 +0100
Re: Ignore error with non-zero exit status Steven D'Aprano <steve@pearwood.info> - 2015-12-22 10:32 +1100
Re: Ignore error with non-zero exit status Terry Reedy <tjreedy@udel.edu> - 2015-12-21 18:53 -0500
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 13:17 +0100
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 11:05 +1100
Re: Ignore error with non-zero exit status Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 17:17 -0700
Re: Ignore error with non-zero exit status Chris Angelico <rosuav@gmail.com> - 2015-12-22 11:25 +1100
Re: Ignore error with non-zero exit status Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 13:30 -0700
Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ben Finney <ben+python@benfinney.id.au> - 2015-12-22 07:58 +1100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 14:16 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-12-21 21:44 +0000
Re: Meaning and purpose of the Subject field Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:55 +0100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Steven D'Aprano <steve@pearwood.info> - 2015-12-22 10:14 +1100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-12-21 23:24 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-21 16:57 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Tim Chase <python.list@tim.thechases.com> - 2015-12-22 09:56 -0600
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Cameron Simpson <cs@zip.com.au> - 2015-12-22 14:36 +1100
Re: Meaning and purpose of the Subject field Random832 <random832@fastmail.com> - 2015-12-21 23:22 -0500
Re: Meaning and purpose of the Subject field Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 13:26 +0100
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Grant Edwards <invalid@invalid.invalid> - 2015-12-22 15:17 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-22 08:28 -0700
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Grant Edwards <invalid@invalid.invalid> - 2015-12-22 22:32 +0000
Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-21 16:55 -0500
Re: Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status) Ganesh Pal <ganesh1pal@gmail.com> - 2015-12-21 08:22 +0530
Re: Ignore error with non-zero exit status Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 08:54 +0100
csiph-web