[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2013-04-09 Thread STINNER Victor

STINNER Victor added the comment:

Barry wrote on python-dev mailing list:
If it's documented to behave that way, why would you still consider it a bug?
The current behavior is clearly intentional, the function is working as
intended, and there may be code out there that depends on this documented
functionality, or at least, it won't be prepared to handle the new exception.
http://mail.python.org/pipermail/python-dev/2012-October/122122.html

So I'm closing the issue.

--
resolution:  - wont fix
status: open - closed

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-07 Thread Stefan Krah

Stefan Krah added the comment:

I don't know the reason for the previous behavior, but it's documented:

http://docs.python.org/dev/c-api/unicode.html?highlight=pyunicode_fromformatv#PyUnicode_FromFormat


An unrecognized format character causes all the rest of the format string to 
be copied as-is to the result string, and any extra arguments discarded.

--
nosy: +skrah

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-07 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch: detect also invalid %.s format and update the documentation.

 I don't know the reason for the previous behavior, but it's documented:

Oh, I missed the doc. Fixed in the new patch.

--
Added file: http://bugs.python.org/file27480/invalid_format-2.patch

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor

New submission from STINNER Victor:

If the format string is invalid, PyUnicode_FromFormatV() formats the valid 
arguments and then copies the raw format string. Errors are silently ignored.

I propose to raise a ValueError if the format string is invalid. This change 
may break existing applications, but I hope that nobody relies on this bug 
:-)

Attached patch implements my proposition.

--
files: invalid_format.patch
keywords: patch
messages: 172250
nosy: haypo
priority: normal
severity: normal
status: open
title: PyUnicode_FromFormatV() must fail if the format string is invalid
versions: Python 3.4
Added file: http://bugs.python.org/file27461/invalid_format.patch

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor

STINNER Victor added the comment:

The full test suite pass with the patch, so hopefully, CPython doesn't rely on 
this bug :-)

--

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



[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor

STINNER Victor added the comment:

Hum, my patch is incomplete: %.s is not seen as an invalid format.

--

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