(obj, encoding='utf-8')
XBMC is currently not fully compliant to the JSON-RPC 2.0 spec.
    When a single argument is passed an array with one element
    should be provied according to the spec, however XBMC expects a
    single value in this case.
    
    See http://forum.xbmc.org/showpost.php?p=671587&postcount=591
XBMC is currently not fully compliant to the JSON-RPC 2.0 spec.
    When a single argument is passed an array with one element
    should be provied according to the spec, however XBMC expects a
    single value in this case.
    
    See http://forum.xbmc.org/showpost.php?p=671587&postcount=591
XBMC is currently not fully compliant to the JSON - RPC 2 . 0 spec . When a single argument is passed an array with one element should be provied according to the spec however XBMC expects a single value in this case . See http : // forum . xbmc . org / showpost . php?p = 671587&postcount = 591
def jdumps(obj, encoding='utf-8'):
    """
    XBMC is currently not fully compliant to the JSON-RPC 2.0 spec.
    When a single argument is passed an array with one element
    should be provied according to the spec, however XBMC expects a
    single value in this case.
    
    See http://forum.xbmc.org/showpost.php?p=671587&postcount=591
    """
    if 'params' in obj and len(obj['params']) == 1:
        obj['params'] = obj['params'][0]
    
    # Do 'serialize' test at some point for other classes
    global cjson
    if cjson:
        return cjson.encode(obj)
    else:
        return json.dumps(obj, encoding=encoding)
def jdumps ( obj , encoding = 'utf-8' ) : if 'params' in obj and len ( obj [ 'params' ] ) == 1 : obj [ 'params' ] = obj [ 'params' ] [ 0 ] # Do 'serialize' test at some point for other classes global cjson if cjson : return cjson . encode ( obj ) else : return json . dumps ( obj , encoding = encoding )