On 8/5/07, Georg Brandl <g.brandl at gmx.net> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4