[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2010-04-02 Thread John Ehresman
John Ehresman j...@wingware.com added the comment: I'm trying to port an existing C extension to py3k and find myself wanting something like PyUnicode_AsString so I don't need to introduce other objects to do memory management. PyUnicode_AsString is equivalent to PyArg_Parse w/ a 's' format

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2009-04-26 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- nosy: +ezio.melotti, haypo priority: - normal type: - feature request versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2799

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-06-06 Thread Stefan Behnel
Stefan Behnel [EMAIL PROTECTED] added the comment: While PyUnicode_AsStringAndSize() may be a better solution if the length is required, PyUnicode_AsString is enough() when it is not required. So I don't buy that argument. Since there are dedicated UTF-8 encoding functions, both functions are

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-06-05 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I now think the proposed changes wouldn't be bad thing, after all. I have been bitten myself by the confusing naming of the Unicode API. So, there is definitely a potential for errors. The main problem with PyUnicode_AsString(), as

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-06-05 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: How about PyUnicode_GetUTF8Buffer() or just PyUnicode_UTF8() ?! -1 Note that the function *must* check the UTF-8 buffer for embedded NUL bytes and then raise an exception if it finds one. Otherwise, the API would silently cause

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-05-23 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I don't agree that PyUnicode_AsString is useless. There are many cases where you don't need the length of the string, e.g. when relying on NULL termination when passing stuff to some C library. I suggest to close this report as works for me.

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-05-22 Thread Haoyu Bai
Changes by Haoyu Bai [EMAIL PROTECTED]: -- nosy: +bhy __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2799 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-05-10 Thread Marc-Andre Lemburg
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment: IMO, it's better to correct API design errors early, rather than going through a deprecation process. Note that PyUnicode_AsString() is also different than its cousind PyString_AsString(). PyString_AsString() is mostly used to access the

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-05-09 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg [EMAIL PROTECTED]: The API PyUnicode_AsString() is pretty useless by itself - there's no way to access the size information of the returned string without again going to the Unicode object. I'd suggest to remove the API altogether and not only deprecating

[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-05-09 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Honestly, I am not sure if removing PyUnicode_AsString() is a good idea. There is many cases where the size of the returned string is not needed. Furthermore, this would be a rather major backward-incompatible change to be included in a