votes up 1

cannot encode objects that are not 2-tuples

Package:
Exception Class:
ValueError

Raise code

""" 

    :rtype: OrderedDict
    """
    if value is None:
        return None

    if isinstance(value, (str, bytes, bool, int)):
        raise ValueError('cannot encode objects that are not 2-tuples')

    return OrderedDict(value)


def to_key_val_list(value):
    """Take an object and test to see if it can be represented as a
    dictionary. If it can be, return a list of tuples, e.g., """
😲  Walkingbet is Android app that pays you real bitcoins for a walking. Withdrawable real money bonus is available now, hurry up! 🚶

Ways to fix

votes up 0 votes down

Summary:

Arguments such as params, cookies and data must have values that are dict or can be converted to dicts (e.g a list of 2-tuples)

Reproduce:

import requests
requests.get("http://www.example.com", params="param1") # param cannot be converted to dict

Fix

import requests
requests.get("http://www.example.com", params={'param1':"true"}) # correct value for params
Jun 02, 2021 cRyp70s answer
cRyp70s 113

Add a possible fix

Please authorize to post fix