alorence / django-modern-rpc

Simple XML-RPC and JSON-RPC server for modern Django
http://django-modern-rpc.rtfd.io
MIT License
98 stars 17 forks source link

Serializing datetime.date in Python 2 #23

Closed melvinkcx closed 6 years ago

melvinkcx commented 6 years ago

Is there anyway to make datetime.date object serializable in Python 2 using XML? It keeps throwing a

 <Fault -32603: "Internal error: Unable to serialize result as valid XML: cannot marshal <type 'datetime.date'> objects">

Thanks.

alorence commented 6 years ago

Returning a datetime.date is fully supported in Python 2. See this RPC stub which is called by this unit test with success. Please provide more information

alorence commented 6 years ago

I still need to have a more information to help you debug this error. On my side, I can send and receive datetime.date objects using XML-RPC protocol without any error. If you can't provide a few line of codes or an example of the issue that I can reproduce, I will close this issue.