patchwork: Modify patchwork code to handle internal RH instance
The internal RH instance of patchwork has a tweaked API. Notably it
embeds a version number into each API call that needs to be filtered.
This adds some logic to autodetect the type of xmlrpc interface using
the generic pw_rpc_version() call. This logic was added to
parse_patchwork_url to help hide the changes from reporter.py. As a
result parse_patchwork_url returns with the rpc pointer instead of
the baseurl.
Further changes includes a 'stringfy' function, copied from our internal
RH instance. OVer the years we have learned, email and python enjoy
delivering text in various forms: ascii, utf-8, iso... Things always
break. stringfy() was our attempt to handle this and reduce all the
breakage from the strange data formats. Over the years it was worked
well. I use it to wrap patch_get_mbox() (which covers the original
utf-8 case).
Signed-off-by: Don Zickus <dzickus@redhat.com>