Marc-Andre Lemburg added the comment:

On 10.11.2013 15:39, Nick Coghlan wrote:
> 
> On 10 November 2013 23:21, Marc-Andre Lemburg <rep...@bugs.python.org> wrote:
>>
>> This doesn't look right:
>>
>> diff -r 1ee45eb6aab9 Include/pyerrors.h
>> --- a/Include/pyerrors.h        Sat Nov 09 23:15:52 2013 +0200
>> +++ b/Include/pyerrors.h        Sun Nov 10 22:54:04 2013 +1000
>> ...
>> +PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause(
>> +    const char *prefix_format,   /* ASCII-encoded string  */
>> +    ...
>> +    );

Sorry about the false warning. After looking at those lines
again, I realized that the "..." is the argument ellipsis,
not some omitted code. At first this look like a function
definition to me :-)

> After sending my previous reply, I realised you may have been
> referring to the comment. I copied that from the PyErr_Format
> signature. According to
> http://docs.python.org/dev/c-api/unicode.html#PyUnicode_FromFormat,
> the format string still has to be ASCII-encoded, and if that's no
> longer true, it's a separate bug from this one that will require a
> docs fix as well.

Also note that it's not clear whether the "ASCII"
refers to the format string or the resulting formatted string.
For the format string, ASCII would probably be fine, but
for the formatted string, UTF-8 should be allowed, since it's
not uncommon to add e.g. parameter strings that caused the
error to the error string.

That's a separate ticket, though.

>> In the error messages, I'd use "codecs.encode()" and "codecs.decode()"
>> (ie. with parens) instead of "codecs.encode" and "codecs.decode".
> 
> Forgot to reply to this part - I like it, will switch it over before 
> committing.

Thanks.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17828>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to