You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Aki Sukegawa (JIRA)" <ji...@apache.org> on 2016/01/11 10:20:40 UTC
[jira] [Resolved] (THRIFT-3503) Enable py:utf8string by default
[ https://issues.apache.org/jira/browse/THRIFT-3503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aki Sukegawa resolved THRIFT-3503.
----------------------------------
Resolution: Fixed
Fix Version/s: 0.9.4
committed
> Enable py:utf8string by default
> -------------------------------
>
> Key: THRIFT-3503
> URL: https://issues.apache.org/jira/browse/THRIFT-3503
> Project: Thrift
> Issue Type: Improvement
> Components: Python - Compiler
> Reporter: Aki Sukegawa
> Assignee: Aki Sukegawa
> Fix For: 0.9.4
>
>
> In python 2 and python 3, string and unicode is handled in very different ways.
> py3: {{str}} is unicode (no such type), it is not {{bytes}}.
> py2: {{str}} is not {{unicode}}, it is (aliased by) {{bytes}}.
> Because of this, while Thrift RPC API handles them as {{str}} for both cases, it is unicode for python3 users but {{bytes}} for python2 users.
> So a user who starts using Thrift + python2 is likely to write code that passes bytes to Thrift API.
> The code is broken when she/he wants to use the code with Thrift + python3.
> We should avoid this by changing this now before the first release of Thrift + Python3.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)