[issue43354] xmlrpc.client: Fault.faultCode erroneously documented to be a string, should be int
New submission from Jürgen Gmach <juergen.gmach@googlemail.com>: 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.fau... 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/255f53bdb54a64b93035374ca4484ba0cc1b4... 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! ---------- assignee: docs@python components: Documentation messages: 387866 nosy: docs@python, jugmac00 priority: normal severity: normal status: open title: xmlrpc.client: Fault.faultCode erroneously documented to be a string, should be int versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
Paul Ganssle <p.ganssle@gmail.com> added the comment: The evidence you have here seems pretty compelling and this change seems straightforward enough. I don't see an expert listed here, but I'm happy to merge a docs PR fixing this. Probably a good idea to make a PR to typeshed in parallel, in case they have some further insight into this. ---------- nosy: +p-ganssle _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
Change by Dong-hee Na <donghee.na@python.org>: ---------- nosy: +corona10 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
Change by Jürgen Gmach <juergen.gmach@googlemail.com>: ---------- keywords: +patch pull_requests: +23482 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24707 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
Jürgen Gmach <juergen.gmach@googlemail.com> added the comment: The approved typeshed PR: https://github.com/python/typeshed/pull/5083 ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 027b6699276ed8d9f68425697ac89bf61e54e6b9 by Jürgen Gmach in branch 'master': bpo-43354: xmlrpc: Fix type documentation for Fault.faultCode (GH-24707) https://github.com/python/cpython/commit/027b6699276ed8d9f68425697ac89bf61e5... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
Jürgen Gmach <juergen.gmach@googlemail.com> added the comment: This was merged already. I did not know I have to manually close the issue, but here we go! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue43354> _______________________________________
participants (4)
-
Dong-hee Na
-
Jürgen Gmach
-
miss-islington
-
Paul Ganssle