[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-06-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-04-03 Thread Francisco Couzo


Francisco Couzo  added the comment:

I just made the pull request, I totally forgot I mentioned I was going to work 
on this, sorry!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-04-03 Thread Francisco Couzo


Change by Francisco Couzo :


--
pull_requests: +12602
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-04-03 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@franciscouzo any status on this? Do you need any help on this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-03-04 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy:  -ceronman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-28 Thread Francisco Couzo


Francisco Couzo  added the comment:

I'm preparing the PR myself

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@dmzz, You can convert the patch into a PR on github or Open a PR with your own 
implementation.

If working with this same patch, the next step would be to test the patch if it 
is still in good shape now before opening a PR.

--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-26 Thread Carlos Damázio

Carlos Damázio  added the comment:

Ops, someone already patched it! Sorry guys.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-26 Thread Carlos Damázio

Carlos Damázio  added the comment:

I've noticed this issue is quite not active, but I'm up on participating in it 
if anyone is doing it already. Since then, this issue still persists:

>>> '{1}'.format()
Traceback (most recent call last):
  File "", line 1, in 
IndexError: tuple index out of range

Reading further, I agree that improving the message is suitable. We should 
leave the Index Exception while changing the text to "Replacement index %d out 
of range for positional args tuple". Even though I find it quite extent for an 
exception message, I guess it couldn't be any other way, unless someone gives a 
better suggestion.

--
nosy: +dmzz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2019-02-24 Thread Manuel Cerón

Change by Manuel Cerón :


--
nosy: +ceronman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-29 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-09 Thread Eric V. Smith

Changes by Eric V. Smith :


--
assignee:  -> eric.smith
versions: +Python 3.6 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-09 Thread Francisco Couzo

Changes by Francisco Couzo :


--
nosy: +franciscouzo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-09 Thread Francisco Couzo

Changes by Francisco Couzo :


--
keywords: +patch
Added file: http://bugs.python.org/file44490/format.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-07-07 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-07-07 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

@terry would a change like this be accepted in 2.7 and 3.4?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-07-07 Thread Eric V. Smith

Eric V. Smith added the comment:

I don't think we can change the exception type in a bugfix release, if ever. I 
don't see much point in changing the exception type: it's just churn.

I'm +1 for a better error message. I'm -0 on changing the error message in a 
bugfix release.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After reading Eric's comments and checking the signature of .format and 
rereading the Format String Syntax section, I have changed my mind. The 
signature of .format is S.format(*args, **kwargs) - str and args is a tuple. 
So the user asks for creation of a tuple by calling .format. The only unusual 
part is the the user also provides indexes into the args tuple, but the doc is 
clear enough that ints passed as specification field names select positional 
arguments. I  think the current message is correct enough to leave alone in 
current releases. An improved message might be

IndexError(Replacement index %d out of range for positional args tuple)

This uses 'replacement index' as a contraction of 'integer passed as 
replacement field name'.

--
type: behavior - enhancement
versions:  -Python 2.7, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-07-05 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
components: +Library (Lib)
keywords: +easy
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-06-29 Thread Roy Smith

New submission from Roy Smith:

https://mail.python.org/pipermail/python-list/2014-June/674188.html

--
messages: 221846
nosy: roysmith
priority: normal
severity: normal
status: open
title: str.format() gives poor diagnostic on placeholder mismatch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-06-29 Thread Roy Smith

Roy Smith added the comment:

(ugh, hit return too soon)

 '{1}'.format()
Traceback (most recent call last):
  File stdin, line 1, in module
IndexError: tuple index out of range

This is a confusing error message.  The user hasn't written any tuples, so a 
message about a tuple index out of range will just leave them scratching their 
head.  We should either return a more specific subclass of IndexError, or at 
least a more descriptive text describing what went wrong.

See https://mail.python.org/pipermail/python-list/2014-June/674188.html for 
background.

--
type:  - behavior
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2014-06-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

IndexError should be caught and replaced with something like
ValueError('format string requests argument not passed') or
TypeError('arguments do not match format string') or more specific
TypeError('format string requests at least %d positional arguments, only %d 
passed')
In Roy's example (a good testcase), the numbers would be 1 and 0.

--
nosy: +eric.smith, terry.reedy
stage:  - needs patch
versions: +Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21879
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com