candlepin/subscription-manager — pull request #1022 by alikins (2014-09-15 17:23:27+00:00)
Title: 1134963: Fix 'release --list' on some systems.

Encode the url path we request the release 'listing'
file from unicode. Depending if 'python-simplejson'
is installed, the Content.url str could be a 'str' or
a 'unicode'. The unicode string is not valid for
inclusion in an URL. This was causing failed GET
requests to the CDN, resulting in 'release --list'
return no results after a 20s timeout.

The exception from the timeout was causing a
httplib.BadStatusLine exception to be logged.

python-simplejson defaults to decoding any
json strings that can be represented as 'str'
to 'str' vs 'unicode'. The default 'json' decoder
always returns unicode strings.

For performance reasons, we attempt to use
python-simplejson if installed, but it is
not a package dep. If it's not installed, the
'release --list' command would fail.