Arrow files are binary, but for some reason NativeFile.write silently converts unicode strings to bytes.
>>> 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'
Reporter: Antoine Pitrou / @pitrou
Assignee: Wes McKinney / @wesm
PRs and other links:
Note: This issue was originally created as ARROW-3227. Please see the migration documentation for further details.
Arrow files are binary, but for some reason
NativeFile.writesilently converts unicode strings to bytes.Reporter: Antoine Pitrou / @pitrou
Assignee: Wes McKinney / @wesm
PRs and other links:
Note: This issue was originally created as ARROW-3227. Please see the migration documentation for further details.