Skip to content

TypeError: get() got multiple values for keyword argument 'connection' #19

@fosstrack

Description

@fosstrack

Following the get examples in the documentation, here's my ipython session.
Using python 2.7.3.

In [1]: from firebase import firebase
In [2]: f = firebase.FirebaseApplication('https://.firebaseio.com')
In [3]: result = f.get('/pins/3', None, None, {'print': 'pretty'}, {'X_FANCY_HEADER': 'VERY FANCY'})


TypeError Traceback (most recent call last)
in ()
----> 1 result = f.get('/pins/3', None, None, {'print': 'pretty'}, {'X_FANCY_HEADER': 'VERY FANCY'})

/home/vagrant/venv/cooliyo/local/lib/python2.7/site-packages/firebase/decorators.pyc in wrapped(_args, *_kwargs)
17 connection.timeout = timeout
18 connection.headers.update({'Content-type': 'application/json'})
---> 19 return f(_args, *_kwargs)
20 return wraps(f)(wrapped)
21 return wrapper

TypeError: get() got multiple values for keyword argument 'connection'


i think the decorator is feeding the 'connection' as a keyword arg, when the get function expects the connection as a positional arg (index = 3) and there are other positional args after it.

Has anyone else run into this problem. Fixed this by modifying the decorator (http_connection) to update the positional arg instead of kwarg.

I am sure I am missing something obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions