This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jugmac00
Recipients docs@python, jugmac00
Date 2021-03-01.13:42:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614606151.94.0.783784524766.issue43354@roundup.psfhosted.org>
In-reply-to
Content
I created a XMLRPC API (via Zope), which gets consumed by a C# application.

C#'s XMLRPC lib expects an `int` for the `faultCode` but I currently return a string, as this is the type which is currently documented in the official docs
https://docs.python.org/3/library/xmlrpc.client.html#xmlrpc.client.Fault.faultCode

This leads to a `TypeMismatch` error on the client's side.


The documentation for `faultCode` is pretty much unchanged since 2007, when `xmlrpc.client.rst` was first created (at least at that place) by Georg Brandl. The docs are most probably older, but I do not know where they were managed before.

I had a look at the cpython source code, and at least the tests all use ints for `faultCode` (both of them :-) )

eg https://github.com/python/cpython/blob/255f53bdb54a64b93035374ca4484ba0cc1b41e1/Lib/test/test_xmlrpc.py#L166

Having a look at the XMLRPC spec at http://xmlrpc.com/spec.md it is clearly shown that `faultCode` has to be an int.

Typeshed recently added type hints for xmlrpc lib, and they used string for `faultCode` - but I guess this is just an aftereffect from the faulty documentation.
https://github.com/python/typeshed/pull/3834

I suggest to both update cpython's documentation and to create a PR for typeshed in order to fix the type issue.

If any core dev agrees on this, I'd like to prepare the pull requests.

Thanks for taking your time to look into this!
History
Date User Action Args
2021-03-01 13:42:31jugmac00setrecipients: + jugmac00, docs@python
2021-03-01 13:42:31jugmac00setmessageid: <1614606151.94.0.783784524766.issue43354@roundup.psfhosted.org>
2021-03-01 13:42:31jugmac00linkissue43354 messages
2021-03-01 13:42:31jugmac00create