astropy/astroquery — pull request #393 by sargas (2014-08-11 00:36:14+00:00)
Title: Remove some Python3 hacks

This is in response to a comment @keflavich made in PR #388 : the temptation to drop Python3 support. Given that Python3 has been out five years, with at least two major distros defaulting to this and more making plans, it seems a little backwards to focus on the legacy versions. I understand the frustration though.

I tried to do away with the decode-if-possible pattern that the existing code uses by keeping a consistant use of Request.content for binary data (as six.binary_type) and Request.text for encoded data (as six.string_types). Encoding is it's own mess of programs that luckily the Requests module does [do](http://docs.python-requests.org/en/latest/user/advanced/#encodings), so might as well pass such issues to that module.

Generally this simplifies the code a bit (120 LOC less), although the tests have to be more careful to use bytes or (potentially unicode-) text as needed, resulting in 16 more LOC. I made a couple more MockRequest classes inherit from the one in utils/testing_tools.py too.

The point of all this is that every variable is definitely a string-type or definitely a byte-type (trivally true in python2). With this, the helpers in astroquery/utils/py3.py are unneeded.