Re: Need help getting my latest rest patches to have python3 compatibility

Joseph Myers <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
On Sun, 10 Mar 2019, John P. Rouillard wrote:

>   using ByteIO (in place of StringIO)

That was correct.  FieldStorage requires a file using bytes, not one using 
strings.

I've applied some general Python 3 fixes for the REST code, as needed to 
be able to get any JSON data from the REST interface at all (in a browser 
as opposed to in the testsuite) when roundup-server is using Python 3, 
and fixes for the tests to use bytes where appropriate.

There is still a failure with Python 3 that I haven't fixed:

>       self.assertEqual(json_dict['data']['type'], "<type 'str'>")
E       AssertionError: "<class 'str'>" != "<type 'str'>"
E       - <class 'str'>
E       + <type 'str'>

This relates to the different results from str(str) in Python 3 versus 
Python 2.  Either the test needs to accept both variants or the REST code 
need to do something to avoid this output depending on the Python version 
used.

-- 
Joseph S. Myers
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.