ozgur/python-firebase

post() got multiple values for keyword argument 'connection error

Closed this issue · 10 comments

I'm getting the following error with the following sample case:

from firebase import firebase
firebase = firebase.FirebaseApplication('https://ustun-test.firebaseio.com', None)

new_activity = {
    "user": "Ustun",
    "action_type": "asked",
    "text": "a text questions",
    "url": "a url"
}

result = firebase.post('/activities', "x", {'print': 'pretty'}, {'a': 'b'})
print result

A sample traceback:

python firebase_integration.py
> /Users/ustun/scv14/lib/python2.7/site-packages/firebase/decorators.py(21)wrapped()
     20             import ipdb; ipdb.set_trace()
---> 21             return f(*args, **kwargs)
     22         return wraps(f)(wrapped)

ipdb> args
args = (<firebase.firebase.FirebaseApplication object at 0x10f05b910>, '/activities', 'x', {'print': 'pretty'}, {'a': 'b'})
kwargs = {'connection': <requests.sessions.Session object at 0x10f0ff890>}
ipdb> kwargs
{'connection': <requests.sessions.Session object at 0x10f0ff890>}
ipdb> c
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
firebase_integration.py in <module>()
      9 }
     10 
---> 11 result = firebase.post('/activities', "x", {'print': 'pretty'}, {'a': 'b'})
     12 print result

/Users/ustun/scv14/lib/python2.7/site-packages/firebase/decorators.py in wrapped(*args, **kwargs)
     19             connection.headers.update({'Content-type': 'application/json'})
     20             import ipdb; ipdb.set_trace()
---> 21             return f(*args, **kwargs)
     22         return wraps(f)(wrapped)
     23     return wrapper

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

Here is what args and kwargs are:

ipdb> args
args = (<firebase.firebase.FirebaseApplication object at 0x10b4df910>, '/activities', 'x', {'print': 'pretty'}, {'a': 'b'})
kwargs = {'connection': <requests.sessions.Session object at 0x10b583890>}
ipdb> kwargs
{'connection': <requests.sessions.Session object at 0x10b583890>}

Can you open up a pull request for that?

I think it's been fixed by this #25. So closing this one.

Still not working on Python 3.4.3

Am facing the same issue .
Post method in firebase.py :
def post(self, url, data, connection, params=None, headers=None): Where connection is the third parameter .

With the example provided :
result = f.post(url , data , {'print' : 'pretty'}) - then assigns the { print : pretty } to the connection and it also creates another one and hence i guess it fails . Removing this argument works fine .

Was this ever corrected? I am still receiving this error on P 2.7 with the latest build of this library. Any parameter as shown above produces this error.

+1 removing the params and headers fixes the problem

+1 please fix

what was the solution??? I have the same problem :(

I also am having the same issue!

well i fixed in my case but... dont forget the "self"
El 29/04/2016 16:58, "arushijain" notifications@github.com escribió:

I also am having the same issue!


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#22 (comment)