[
https://issues.apache.org/jira/browse/THRIFT-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689332#action_12689332
]
Jonathan Ellis commented on THRIFT-395:
---------------------------------------
There's really no two ways around it: the old behavior (treating all strings as
binary) was a bug.
I think option (1) clearly violates the spirit of python ("in the face of
ambiguity, refuse the tempation to guess") in a way that is guaranteed to cause
problems. If a program relies on buggy behavior, let's fail fast rather than
working "sometimes."
As for option (2) I don't think I should be required to use a decorator to get
correct behavior. I would suggest a decorator to get the _buggy_ behavior but
(a) that seems ... wrong, and (b) how hard is it to regenerate your api with
s/string/binary/ anyway? You'll get the _exact_ behavior as before. I still
don't see how this is a big deal.
> Python library + compiler does not support unicode strings
> ----------------------------------------------------------
>
> Key: THRIFT-395
> URL: https://issues.apache.org/jira/browse/THRIFT-395
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (Python), Library (Python)
> Reporter: Jonathan Ellis
> Assignee: Jonathan Ellis
> Priority: Blocker
> Fix For: 0.1
>
> Attachments: python-utf8-v2.patch, python-utf8.patch
>
>
> Effectively, all strings in the python bindings are treated as binary strings
> -- no encoding/decoding to UTF-8 is done. So if a unicode object is passed
> to a (regular, non-binary) string, an exception is raised.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.