[Python-Dev] Disabling Unicode readbuffer interface

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Wed, 20 Sep 2000 21:57:16 +0200


martin wrote:
> More concerning, sre fails when matching a unicode string. sre uses
> the getreadbufferproc to get to the internal representation. If it has
> sizeof(Py_UNICODE) times as many bytes as it is long, we got a unicode
> buffer (?!?).

...or an integer buffer.

(who says you can only use regular expressions on character
strings? ;-)

> I'm not sure what the right solution would be in this case: I *think*
> sre should have more specific knowledge of Unicode objects, so it
> should support objects with a buffer interface representing a 1-byte
> character string, or Unicode objects. Actually, is there anything
> wrong with sre operating on string and unicode objects only?

let's add a special case for unicode strings.  I'm actually using
the integer buffer support (don't ask), so I'd prefer to leave it
in there.

no time tonight, but I can check in a fix tomorrow.

</F>