This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients Arfrever, amaury.forgeotdarc, belopolsky, ezio.melotti, jafo, lemburg, loewis, ronaldoussoren, vstinner
Date 2010-12-07.19:02:25
SpamBayes Score 4.4424575e-11
Marked as misclassified No
Message-id <4CFE84C0.7020506@egenix.com>
In-reply-to <AANLkTi=qKxFm+tfXWqncuOgy+gG+GZ4mWXCteBUuL3_A@mail.gmail.com>
Content
Alexander Belopolsky wrote:
> 
> Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
> 
> On Tue, Dec 7, 2010 at 1:11 PM, Marc-Andre Lemburg
> <report@bugs.python.org> wrote:
>>>  I am not sure what
>>> you mean by "a parser API."
>>
>> PyArg_Parse() et al. See the discussion earlier on this ticket.
>>
> 
> I've just realized that.  It is the "u#" code.  Yes, I'll see if I can
> use it instead of "U", but I think in the affected code the PyUnicode
> object is needed as well.
> 
>>> ..  this is very similar to xmlparser_getattro
>>> in _elementtree.c and I think should be handled the same way.
>>
>> Not sure what you mean here. If you ignore errors and don't clear
>> the exception, it will pop up at some later point in processing
>> and that's generally very confusing.
>>
> 
> I mean not converting to char* at all and use
> PyUnicode_CompareWithASCIIString() instead of strcmp().  I wish that
> function had a shorter name, though, but it is not a big deal to spell
> it out. 

Agreed; not my invention ;-) I would have used
PyUnicode_CompareToUTF8() or something along those lines.

> BTW, I don't think there is a way to use wchar_t* literals in
> Python code, right?  As in Py_UNICODE_strcmp(name, L"version").

No, since wchar_t may be something completely different than
Py_UNICODE.

No sure about today's situation, but at least a couple of years
ago wchar_t was not defined on all supported platforms, e.g.
Crays didn't have it.
History
Date User Action Args
2010-12-07 19:02:27lemburgsetrecipients: + lemburg, loewis, jafo, ronaldoussoren, amaury.forgeotdarc, belopolsky, vstinner, ezio.melotti, Arfrever
2010-12-07 19:02:25lemburglinkissue6697 messages
2010-12-07 19:02:25lemburgcreate