This will permit the deletion of just that one file in order
to fall back to the [probably more accurate but less consistent]
Distro provided CA certs.
JSON *must* be encoded using UTF-8, UTF-16 or UTF-32 (see the [RFC][1]; detect the encoding based on the fact that JSON always starts with 2 ASCII characters.
[1]: http://tools.ietf.org/html/rfc4627#section-3
compat.py: relevant imports added
utils.py: then those imports are imported here.
Nothing else was changed, but I saw mentions of quoting later in
utils.py but I wasnt sure what to do about that.
This replaces the sys.path hack with a slightly less objectionable
sys.modules hack.
Both have the effect of making the vendored lib's absolue imports work
as expected when oauthlib isn't installed. The sys.modules hack doesn't
insert the rest of the vendored crap in a global path, however.
Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
If encoding is None, decoding will throw the following TypeError:
TypeError: unicode() argument 2 must be string, not None
If this is the case, attempt to run without any set encoding
Prior to this, you could sneak a list of anything to register_hook and it
would accept it. This will check if the items in the list are callable before
registering them. Also added a regression test to make sure if this gets
changed it will be noticed.
If encoding is None, decoding will throw the following TypeError:
TypeError: unicode() argument 2 must be string, not None
If this is the case, attempt to run without any set encoding
This allows iter_content and iter_lines to succeed without
crashing even after the response content has been fetched
(iter_content gives you an iterator over the prefetched
content)