On Sun, Mar 8, 2015 at 6:20 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: > * it still isn't bijective between str and bytes: > > >>> '\udd00'.encode('utf-8', errors='surrogateescape') > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > UnicodeEncodeError: 'utf-8' codec can't encode character > '\udd00' in position 0: surrogates not allowed
Once again, you appear to be surprised that invalid data is failing. Why is this so strange? U+DD00 is not a valid character. It is quite correct to throw this error. ChrisA -- https://mail.python.org/mailman/listinfo/python-list