]> git.ozlabs.org Git - patchwork/commit
xmlrpc: Avoid trying to marshall None for people with no name
authorDoug Anderson <dianders@chromium.org>
Fri, 21 Dec 2012 13:42:43 +0000 (13:42 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Sun, 30 Dec 2012 01:38:24 +0000 (09:38 +0800)
commit6dede3e067edfeec16682ff7500e1b7c25663016
treecf4a5aa4010375e4d734ffc8a027c943743100b9
parentbfb1ddb628ed1bea06d6eba5c6cc7a1c71abf5af
xmlrpc: Avoid trying to marshall None for people with no name

If a person sent patches with no real name, they may have None for
their name.  In this case just use their email address as their name.

The previous pwclient error that would show up looks like:

  $ pwclient list -w anonymous@example.com
  Traceback (most recent call last):
    File ".../pwclient", line 631, in <module>
      main()
    File ".../pwclient", line 570, in main
      action_list(rpc, filt, submitter_str, delegate_str, series_str)
    File ".../pwclient", line 316, in action_list
      ids = person_ids_by_name(rpc, submitter_str)
    File ".../pwclient", line 241, in person_ids_by_name
      people = rpc.person_list(name, 0)
    File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
      return self.__send(self.__name, args)
    File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
      verbose=self.__verbose
    File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
      return self.single_request(host, handler, request_body, verbose)
    File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
      return self.parse_response(response)
    File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
      return u.close()
    File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
      raise Fault(**self._stack[0])
  xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal None unless allow_none is enabled">

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/views/xmlrpc.py