Skip to content

Commit

Permalink
fix python unicode string
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmoritz committed Aug 15, 2017
1 parent 30bb960 commit 2171761
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cpp/src/arrow/python/python_to_arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ Status CallCustomSerializationCallback(PyObject* elem, PyObject** serialized_obj
*serialized_object = NULL;
if (!pyarrow_serialize_callback) {
std::stringstream ss;
ss << "data type of " << PyUnicode_AsUTF8(PyObject_Repr(elem))
PyObject* repr = PyObject_Repr(elem);
PyObject* ascii = PyUnicode_AsASCIIString(repr);
ss << "data type of " << PyBytes_AsString(ascii)
<< " not recognized and custom serialization handler not registered";
Py_XDECREF(ascii);
Py_XDECREF(repr);
return Status::NotImplemented(ss.str());
} else {
PyObject* arglist = Py_BuildValue("(O)", elem);
Expand Down

0 comments on commit 2171761

Please sign in to comment.