raulcd commented on code in PR #50409:
URL: https://github.com/apache/arrow/pull/50409#discussion_r3541916771


##########
python/pyarrow/src/arrow/python/helpers.cc:
##########
@@ -121,12 +122,29 @@ std::string PyObject_StdStringRepr(PyObject* obj) {
   if (!bytes_ref) {
     PyErr_Clear();
     std::stringstream ss;
-    ss << "<object of type '" << Py_TYPE(obj)->tp_name << "' repr() failed>";
+    ss << "<object of type '" << PyObject_StdStringTypeName(obj) << "' repr() 
failed>";
     return ss.str();
   }
   return PyBytes_AsStdString(bytes_ref.obj());
 }
 
+std::string PyObject_StdStringTypeName(PyObject* obj) {
+  // Once Python 3.10 is dropped, this can use PyType_GetName(Py_TYPE(obj)) 
(added in 3.11).

Review Comment:
   To be fair we are just about to release 25.0.0, Release Candidate already 
created and being voted, which is the last release which will support Python 
3.10. We could just drop 3.10 from main any time now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to