[Guido] > > Adding unistr() and StreamRecoder isn't enough. The problem is that > > when you set sys.stdout to a StreamRecoder, the print statement > > doesn't do the right thing! Try it. print u"foo" will work, but > > print u"\u1234" will fail because print always applies the default > > encoding. [MAL] > Hmm, that's due to PyFile_WriteObject() calling PyObject_Str(). > Perhaps we ought to let it call PyObject_Unicode() (which you > find in the patch on SF) instead for Unicode objects. That way > the file-like .write() method will be given a Unicode object > and StreamRecoder could then do the trick. That's still not enough. Classes and types should be able to have a __str__ (or tp_str) that yields Unicode too. --Guido van Rossum (home page: http://www.python.org/~guido/)
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