Skip to content

TypeError: session() takes no arguments (2 given) #172

kappa opened this Issue Dec 23, 2012 · 6 comments

5 participants

kappa commented Dec 23, 2012

I get this trace trying to run subliminal from master branch:

ERROR: subliminal.async Exception raised in worker Thread-1
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/subliminal-0.6.2-py2.7.egg/subliminal/", line 47, in run
result = consume_task(task,
File "/usr/local/lib/python2.7/dist-packages/subliminal-0.6.2-py2.7.egg/subliminal/", line 130, in consume_task
service = get_service(services, task.service, config=task.config)
File "/usr/local/lib/python2.7/dist-packages/subliminal-0.6.2-py2.7.egg/subliminal/", line 207, in get_service
File "/usr/local/lib/python2.7/dist-packages/subliminal-0.6.2-py2.7.egg/subliminal/services/", line 90, in init
super(OpenSubtitles, self).init()
File "/usr/local/lib/python2.7/dist-packages/subliminal-0.6.2-py2.7.egg/subliminal/services/", line 84, in init
self.session = requests.session(timeout=10, headers={'User-Agent': self.user_agent})
TypeError: session() takes no arguments (2 given)

I have requests 1.0.4 installed.

kappa commented Dec 23, 2012

I managed to fix it by downgrading to tags. The oldest that works is "v0.4".

Diaoul commented Dec 23, 2012

A lot of changes to the API lately it seems. I'll try to adapt to requests 1.x but I cannot find any docs about the changes to Session objects.

@Diaoul Diaoul was assigned Dec 23, 2012

I get the same error.


This worked for me:
uninstall requests: sudo pip uninstall -y requests
install requests version 0.14.2: sudo pip install requests==0.14.2

mindw commented Jan 11, 2013

See here for a solution involving "requests-transition".

Diaoul commented Jan 11, 2013

If I have to change some code I'll add compatibility for requests 1.0 instead of using this. For now, I don't know how to do that and haven't enough time to search for a solution.

@Diaoul Diaoul pushed a commit that closed this issue Jan 13, 2013
@rik rik Update to the latest requests API.
fix #172
@Diaoul Diaoul closed this in 04c74af Jan 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.