Re: [Python-Dev] Issue #16153: PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-08 Thread Barry Warsaw
On Oct 07, 2012, at 11:09 PM, Victor Stinner wrote:

>Does anyone know if there is a good reason why PyUnicode_FromFormatV()
>does not fail on invalid format string, but copies the format string
>as-if into the result?
>
>I would like to change this to raise a ValueError instead.
>PyUnicode_FromFormatV() is used by PyErr_Format(), so PyErr_Format()
>may now fail with a ValueError if the format string is invalid.

This behavior is inherited from PyUnicode_FromFormat() which documents the
current behavior, so you can't change this in backward incompatible way.

Cheers,
-Barry
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Issue #16153: PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-08 Thread Victor Stinner
2012/10/8 Barry Warsaw :
>>Does anyone know if there is a good reason why PyUnicode_FromFormatV()
>>does not fail on invalid format string, but copies the format string
>>as-if into the result?
>>
>>I would like to change this to raise a ValueError instead.
>>PyUnicode_FromFormatV() is used by PyErr_Format(), so PyErr_Format()
>>may now fail with a ValueError if the format string is invalid.
>
> This behavior is inherited from PyUnicode_FromFormat() which documents the
> current behavior, so you can't change this in backward incompatible way.

Yes, the current behaviour is documented, but I consider it as a bug. Would
it be possible to change the behaviour to fix a "bug"?

Victor
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Issue #16153: PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-08 Thread Barry Warsaw
On Oct 08, 2012, at 11:23 PM, Victor Stinner wrote:

>2012/10/8 Barry Warsaw :
>>>Does anyone know if there is a good reason why PyUnicode_FromFormatV()
>>>does not fail on invalid format string, but copies the format string
>>>as-if into the result?
>>>
>>>I would like to change this to raise a ValueError instead.
>>>PyUnicode_FromFormatV() is used by PyErr_Format(), so PyErr_Format()
>>>may now fail with a ValueError if the format string is invalid.
>>
>> This behavior is inherited from PyUnicode_FromFormat() which documents the
>> current behavior, so you can't change this in backward incompatible way.
>
>Yes, the current behaviour is documented, but I consider it as a bug. Would
>it be possible to change the behaviour to fix a "bug"?

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.

Cheers,
-Barry


signature.asc
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Issue #16153: PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-08 Thread Serhiy Storchaka

On 09.10.12 00:23, Victor Stinner wrote:

Yes, the current behaviour is documented, but I consider it as a bug.
Would it be possible to change the behaviour to fix a "bug"?


You should follow the deprecation procedure.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com