Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: request() got an unexpected keyword argument 'json' #51

Open
stgreenb opened this issue Aug 31, 2019 · 5 comments
Open

TypeError: request() got an unexpected keyword argument 'json' #51

stgreenb opened this issue Aug 31, 2019 · 5 comments

Comments

@stgreenb
Copy link

Run from python 2.7 (not docker, which failed see other ticket) on amazon ec2 errors on recent trip.

Attempting check-in...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 804, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 757, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./checkin.py", line 43, in schedule_checkin
    data = reservation.checkin()
  File "/home/ec2-user/swc/SouthwestCheckin/southwest/southwest.py", line 81, in checkin
    confirmation = self.load_json_page(url, info_needed['body'])
  File "/home/ec2-user/swc/SouthwestCheckin/southwest/southwest.py", line 59, in load_json_page
    data = self.safe_request(url, body)
  File "/home/ec2-user/swc/SouthwestCheckin/southwest/southwest.py", line 42, in safe_request
    r = requests.post(url, headers=headers, json=body)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
    return request('post', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'json'
@pandabear41
Copy link

Did you set a notification? I had the same problem when I added a SMS notification.

@scho7623
Copy link

I'm still seeing this error message. Was this resolved? Any workarounds? cc: @stgreenb @pandabear41

@pandabear41
Copy link

pandabear41 commented Feb 12, 2020

@scho7623
The error with notification was fixed a while ago then shortly after that feature was removed.
Otherwise you are running a super old version of requests. Can you find what version of requests you are running?
python -c "import requests; print(requests.__version__)"

You can try upgrading requests.

@scho7623
Copy link

Thanks @pandabear41 , it was indeed super old 2.2.1. I upgraded to 2.22.0 and it works fine now. Thanks.

@urllib
Copy link

urllib commented Aug 11, 2020

Is there a change in the anti-climbing strategy?Can you explain that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants