Need help getting my latest rest patches to have python3 compatibility

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi all:

I commited a couple of patches to rest.py over the weekend. I have
some tests failing on python 3. I managed to get a couple of the
python2 -> 3 issues resolved, but I am stumped on how to get
testDispatch in test/rest_common.py to work.

The problem is getting the json body payload to go through the code
successfully. It works under python2, but not python3.4.3.

The things I have tried to make it work:

  using ByteIO (in place of StringIO)
  making strings into bytes (s2b from roundup.anypy.strings)
  using unicode strings (and conversions)

but all these attempts cause exceptions in hyperdb when normalizing
line endings using text.replace (text isn't of a type that has a
replace method), or class_obj.set(item_id, **props) fails because the
value is a bytestring and not unicode (or str).

Can somebody versed in the 2->3 conversion take a look and figure out
how to make the first test case work under both python2 and 3. Once I
get that I think all the rest of the cases is just applying the same
change over and over.

If you have questions, please ask.

Thanks.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
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.