[issue1467929] %-formatting and dicts

2018-07-30 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> wont fix
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



[issue1467929] %-formatting and dicts

2018-07-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Eric V. Smith]
>  But the issue is 12 years old and doesn't cause any real problems 
> as far as I can see, so it's hard to get excited about it. 
> And as we've seen there are a lot of corner cases. I'd hate to 
> make things worse.

I ooncur with Eric and think this ought to be closed. It is a oddity but has 
proven itself to be harmless in the wild.  At this point in the life cycle of 
%-formatting it would be prudent to value stability over niggling behavior 
changes.

--
nosy: +rhettinger

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2018-07-29 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2018-07-29 Thread Tal Einat


Tal Einat  added the comment:

Ah, sorry Eric, I misread that change as you assigning this to yourself.

--
versions: +Python 3.8 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2018-07-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

I unassigned myself from this a few months ago. If someone wants to fix it, I'm 
not opposed. But the issue is 12 years old and doesn't cause any real problems 
as far as I can see, so it's hard to get excited about it. And as we've seen 
there are a lot of corner cases. I'd hate to make things worse.

--

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2018-07-28 Thread Tal Einat


Tal Einat  added the comment:

Eric, would you like an update PR for this?

--
nosy: +taleinat

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2018-03-19 Thread Eric V. Smith

Change by Eric V. Smith :


--
assignee: eric.smith -> 

___
Python tracker 

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



[issue1467929] %-formatting and dicts

2014-12-31 Thread A.M. Kuchling

Changes by A.M. Kuchling a...@amk.ca:


--
nosy:  -akuchling

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



[issue1467929] %-formatting and dicts

2014-10-10 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue1467929] %-formatting and dicts

2011-10-30 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
stage: needs patch - patch review
versions: +Python 3.3

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



[issue1467929] %-formatting and dicts

2010-10-20 Thread Vetoshkin Nikita

Changes by Vetoshkin Nikita nikita.vetosh...@gmail.com:


Removed file: http://bugs.python.org/file19271/issue1467929_py3k.diff

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



[issue1467929] %-formatting and dicts

2010-10-20 Thread Vetoshkin Nikita

Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment:

Updated patch: some tests added.

--
Added file: http://bugs.python.org/file19307/issue1467929_py3k.diff

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



[issue1467929] %-formatting and dicts

2010-10-18 Thread Vetoshkin Nikita

Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment:

Updated patch against py3k. Fixing last reported issue with
'%(a)s %%' % {'a':'xyz'}

--
nosy: +nvetoshkin
Added file: http://bugs.python.org/file19270/issue1467929_py3k.diff

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



[issue1467929] %-formatting and dicts

2010-10-18 Thread Vetoshkin Nikita

Changes by Vetoshkin Nikita nikita.vetosh...@gmail.com:


Removed file: http://bugs.python.org/file19270/issue1467929_py3k.diff

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



[issue1467929] %-formatting and dicts

2010-10-18 Thread Vetoshkin Nikita

Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment:

Updated patch to capture another patological case:
'%(a)s %' % {'a':'xyz'} - incomplete formatter at the end of the line

--
Added file: http://bugs.python.org/file19271/issue1467929_py3k.diff

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



[issue1467929] %-formatting and dicts

2010-09-11 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue1467929] %-formatting and dicts

2010-09-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Too late for 2.x and 3.1.

--
nosy: +flox
versions:  -Python 2.7, Python 3.1

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



[issue1467929] %-formatting and dicts

2010-08-22 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
stage:  - needs patch
versions: +Python 3.2

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



[issue1467929] %-formatting and dicts

2010-05-20 Thread Skip Montanaro

Changes by Skip Montanaro s...@pobox.com:


--
nosy:  -skip.montanaro

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



[issue1467929] %-formatting and dicts

2009-04-27 Thread Eric Smith

Changes by Eric Smith e...@trueblade.com:


--
assignee: jafo - eric.smith
versions: +Python 2.7 -Python 2.6

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



[issue1467929] %-formatting and dicts

2009-04-27 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

The patch incorrectly raises an exception for:
'%(a)s %%' % {'a':'xyz'}

I'll look into fixing it.

--

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



[issue1467929] %-formatting and dicts

2009-04-26 Thread Daniel Diniz

Daniel Diniz aja...@gmail.com added the comment:

Confirmed in trunk and py3k. How about changing this for 3.1?

--
keywords: +patch
nosy: +ajaksu2, benjamin.peterson, eric.smith
type:  - behavior
versions: +Python 3.1 -Python 2.5

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



[issue1467929] %-formatting and dicts

2008-05-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:

I guess the patch was just forgotten after the 2.5 release was out.

I've added a 2.6 tag and assigned the patch to Sean.

--
assignee: anthonybaxter - jafo
versions: +Python 2.6

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1467929] %-formatting and dicts

2008-05-13 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

This probably won't be important anymore now that we have str.format()...

--
priority: normal - low

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1467929] %-formatting and dicts

2008-05-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:

Sean, why don't you just check in the patch ?

Then we can close the bug.

Georg, the fact that we have an alternative method for string formatting
doesn't mean that it's ok for Python to hide error using the prevailing
method of string formatting.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1467929] %-formatting and dicts

2008-05-13 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

I didn't want to imply that, but seeing that nobody cared about it for
so long I hadn't much hope for the future... ;)

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1467929] %-formatting and dicts

2007-08-30 Thread Guido van Rossum

Changes by Guido van Rossum:


--
priority: immediate - normal

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1467929] %-formatting and dicts

2007-08-25 Thread Sean Reifschneider

Sean Reifschneider added the comment:

I'm attaching a new version of this which includes AMK's string patch
ported over to unicode.

Any objections to my committing this to the trunk?  Should it also go in
for the next 2.5 release?

--
nosy: +jafo

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1467929
_Index: Objects/unicodeobject.c
===
--- Objects/unicodeobject.c	(revision 57477)
+++ Objects/unicodeobject.c	(working copy)
@@ -7730,12 +7730,19 @@
 */
 #define FORMATBUFLEN (size_t)120
 
+/* Constants for the type of % argument being used -- not known, 
+   a mapping, or a tuple. */
+#define FORMAT_TYPE_UNKNOWN 0
+#define FORMAT_TYPE_MAPPING 1
+#define FORMAT_TYPE_TUPLE 2
+
 PyObject *PyUnicode_Format(PyObject *format,
 			   PyObject *args)
 {
 Py_UNICODE *fmt, *res;
 Py_ssize_t fmtcnt, rescnt, reslen, arglen, argidx;
 int args_owned = 0;
+int format_type = FORMAT_TYPE_UNKNOWN;
 PyUnicodeObject *result = NULL;
 PyObject *dict = NULL;
 PyObject *uformat;
@@ -7806,6 +7813,13 @@
 format requires a mapping);
 		goto onError;
 		}
+		if (format_type == FORMAT_TYPE_TUPLE) {
+		PyErr_SetString(PyExc_ValueError,
+both keyed and unkeyed format 
+specifiers used);
+		goto onError;
+		}
+		format_type = FORMAT_TYPE_MAPPING;
 		++fmt;
 		--fmtcnt;
 		keystart = fmt;
@@ -7849,6 +7863,15 @@
 		arglen = -1;
 		argidx = -2;
 	}
+	else if (format_type == FORMAT_TYPE_MAPPING) {
+		PyErr_SetString(PyExc_ValueError,
+both keyed and unkeyed format specifiers used
+);
+		goto onError;
+	}
+	else if (format_type == FORMAT_TYPE_UNKNOWN) {
+		format_type = FORMAT_TYPE_TUPLE;
+	}
 	while (--fmtcnt = 0) {
 		switch (c = *fmt++) {
 		case '-': flags |= F_LJUST; continue;
Index: Objects/stringobject.c
===
--- Objects/stringobject.c	(revision 57477)
+++ Objects/stringobject.c	(working copy)
@@ -4455,6 +4455,12 @@
 */
 #define FORMATBUFLEN (size_t)120
 
+/* Constants for the type of % argument being used -- not known, 
+   a mapping, or a tuple. */
+#define FORMAT_TYPE_UNKNOWN 0
+#define FORMAT_TYPE_MAPPING 1
+#define FORMAT_TYPE_TUPLE 2
+
 PyObject *
 PyString_Format(PyObject *format, PyObject *args)
 {
@@ -4462,6 +4468,7 @@
 	Py_ssize_t arglen, argidx;
 	Py_ssize_t reslen, rescnt, fmtcnt;
 	int args_owned = 0;
+	int format_type = FORMAT_TYPE_UNKNOWN;
 	PyObject *result, *orig_args;
 #ifdef Py_USING_UNICODE
 	PyObject *v, *w;
@@ -4534,6 +4541,12 @@
 		 format requires a mapping);
 	goto error;
 }
+if (format_type == FORMAT_TYPE_TUPLE) {
+	PyErr_SetString(PyExc_ValueError,
+		 both keyed and unkeyed format specifiers used);
+	goto error;
+}
+format_type = FORMAT_TYPE_MAPPING;
 ++fmt;
 --fmtcnt;
 keystart = fmt;
@@ -4568,6 +4581,14 @@
 arglen = -1;
 argidx = -2;
 			}
+			else if (format_type == FORMAT_TYPE_MAPPING) {
+			  PyErr_SetString(PyExc_ValueError,
+	  both keyed and unkeyed format specifiers used);
+			  goto error;
+			}
+			else if (format_type == FORMAT_TYPE_UNKNOWN) {
+			  format_type = FORMAT_TYPE_TUPLE;
+			}
 			while (--fmtcnt = 0) {
 switch (c = *fmt++) {
 case '-': flags |= F_LJUST; continue;


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