Python - XML 格式不正确(无效标记)调试值

Python - XML not well-formed (invalid token) Debug Values

当我尝试导入一些销售订单时出现此错误,我需要调试 return 语句的值,但除了错误我什么也没得到。该代码适用于大多数销售订单,但我在几个订单上遇到了错误,而且我无法识别错误。

我尝试使用 print_r() 和 var_dump() 但没有用。

Python 是 return 错误 "ValueError: " 格式不正确(无效标记)。

谢谢。

$saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),
                "price_type" => new xmlrpcval( clean_special_chars($price_type), "string" ),
                "note" => new xmlrpcval(clean_special_chars($note), "string" ),
                "lines" => new xmlrpcval( $orderlines, "array"),
                "pay_met" => new xmlrpcval( search_payment_method($row[24]), "int"),
                "pay_met_title" => new xmlrpcval( clean_special_chars($row[24]), "string"),
                "shipping_price" => new xmlrpcval( $shopping_price, "double"),
                "shipping_title" => new xmlrpcval(html_entity_decode(clean_special_chars($shipping_title)), "string"),
                "orders_status" => new xmlrpcval( clean_special_chars($status), "string"),
                "partner" => $partner,
                "date" => new xmlrpcval( $row[21], "string"),
                "address" => $default_address,
                "delivery" => $delivery_address,
                "billing" => $billing_address,
                "order_subtotal" => new xmlrpcval($order_subtotal, "double"),
                "order_tax" => new xmlrpcval($order_tax, "double"),
                "order_total" => new xmlrpcval($order_total, "double"),
            ), "struct");

return new xmlrpcresp(new xmlrpcval($saleorders, "array"));

尝试使用 xmlrpcval 的序列化方法查看值 Link: https://gggeek.github.io/jsxmlrpc/javadoc/xmlrpcval.html#serialize