[ https://issues.apache.org/jira/browse/ARROW-3227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wes McKinney resolved ARROW-3227. --------------------------------- Resolution: Fixed Issue resolved by pull request 2570 [https://github.com/apache/arrow/pull/2570] > [Python] NativeFile.write shouldn't accept unicode strings > ---------------------------------------------------------- > > Key: ARROW-3227 > URL: https://issues.apache.org/jira/browse/ARROW-3227 > Project: Apache Arrow > Issue Type: Bug > Components: Python > Affects Versions: 0.10.0 > Reporter: Antoine Pitrou > Assignee: Wes McKinney > Priority: Major > Labels: pull-request-available > Fix For: 0.11.0 > > Time Spent: 10m > Remaining Estimate: 0h > > Arrow files are binary, but for some reason {{NativeFile.write}} silently > converts unicode strings to bytes. > {code:python} > >>> b = io.BytesIO() > >>> b.write("foo") > Traceback (most recent call last): > File "<ipython-input-6-a7195dbc0372>", line 1, in <module> > b.write("foo") > TypeError: a bytes-like object is required, not 'str' > >>> f = pa.PythonFile(b) > >>> f.write("foo") > >>> b.getvalue() > b'foo' > >>> f.write("😀") > >>> b.getvalue() > b'foo\xf0\x9f\x98\x80' > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)