On 8/5/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > See bugs #1548891 and #1730114. > > In the former, it was reported that cStringIO works differently from StringIO > when handling unicode strings; it used GetReadBuffer which returned the raw > internal UCS-2 or UCS-4 encoded string. > > I changed it to use GetCharBuffer, which converts to a string using the > default encoding first. This fix was also in 2.5.1. > > The latter bug now complains that this excludes things like array.array()s > from being used as an argument to cStringIO.StringIO(), which worked before > with GetReadBuffer. > > What's the preferred solution here? >
The best thing would be add a special case for ascii-only unicode objects, and keep the old behavior. However, I believe this will be ugly, especially in O_write. So, it would perhaps be better to simply stop supporting unicode objects. -- Alexandre _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com