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

ERROR: readline() takes exactly 1 argument (2 given) #6727

Closed
Garfield222 opened this issue Sep 1, 2015 · 4 comments
Closed

ERROR: readline() takes exactly 1 argument (2 given) #6727

Garfield222 opened this issue Sep 1, 2015 · 4 comments

Comments

@Garfield222
Copy link

@Garfield222 Garfield222 commented Sep 1, 2015

I get this error message ONLY WHEN http_proxy variable is set.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'-ciw', u'-f', u'bestaudio', u'--write-all-thumbnails', u'--no-mtime', u'--download-archive', u'.archive.txt', u'--playlist-start', u'1', u'https://www.youtube.com/watch?v=tVAI3voBG1E&list=RDtVAI3voBG1E']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2015.08.28
[debug] Python version 2.7.10 - CYGWIN_NT-6.1-WOW-2.2.0-0.289-5-3-i686-32bit
[debug] exe versions: ffmpeg N-72346-ga838b22, ffprobe N-72346-ga838b22
[debug] Proxy map: {'http': '78.188.251.242:8080', u'https': '78.188.251.242:8080'}
[youtube:playlist] Downloading playlist RDtVAI3voBG1E - add --no-playlist to just download video tVAI3voBG1E
[youtube:playlist] RDtVAI3voBG1E: Downloading Youtube mix
ERROR: readline() takes exactly 1 argument (2 given)
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 655, in extract_info
ie_result = ie.extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 287, in extract
return self._real_extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1572, in _real_extract
return self._extract_mix(playlist_id)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1485, in _extract_mix
url, playlist_id, 'Downloading Youtube mix')
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 438, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 345, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 326, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1860, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 749, in https_open
req, *_kwargs)
File "/usr/lib/python2.7/urllib2.py", line 1194, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/usr/lib/python2.7/httplib.py", line 1053, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1093, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1049, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 893, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 855, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1266, in connect
HTTPConnection.connect(self)
File "/usr/lib/python2.7/httplib.py", line 835, in connect
self._tunnel()
File "/usr/lib/python2.7/httplib.py", line 819, in _tunnel
line = response.fp.readline(_MAXLINE + 1)
TypeError: readline() takes exactly 1 argument (2 given)

@Garfield222
Copy link
Author

@Garfield222 Garfield222 commented Sep 1, 2015

Python 2.7.10

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 1, 2015

It works fine for me, that line of code is executed without problem. Could you try with an official cpython build?

@Garfield222
Copy link
Author

@Garfield222 Garfield222 commented Sep 1, 2015

I tried with latest python python-2.7.10.msi (md5sum 4ba2c79b103f6003bc4611c837a08208).
Started from CMD with windows python.
Same error:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-ciw', u'-f', u'bestaudio', u'--write-all-thumbnails', u'--no-mtime', u'--download-archive', u'.archive.txt', u'--playlist-start', u'1', u'-a', u'alink.txt', u'--verbose']
[debug] Batch file urls: [u'https://www.youtube.com/watch?v=tVAI3voBG1E&list=RDtVAI3voBG1E']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2015.08.28
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-72346-ga838b22, ffprobe N-72346-ga838b22
[debug] Proxy map: {'http': '223.19.230.181:80', u'https': '223.19.230.181:80'}
[youtube:playlist] Downloading playlist RDtVAI3voBG1E - add --no-playlist to just download video tVAI3voBG1E
[youtube:playlist] RDtVAI3voBG1E: Downloading Youtube mix
ERROR: readline() takes exactly 1 argument (2 given)
Traceback (most recent call last):
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\YoutubeDL.py", line 655, in extract_info
ie_result = ie.extract(url)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\common.py", line 287, in extract
return self._real_extract(url)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\youtube.py", line 1572, in _real_extract
return self._extract_mix(playlist_id)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\youtube.py", line 1485, in _extract_mix
url, playlist_id, 'Downloading Youtube mix')
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\common.py", line 438, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\common.py", line 345, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\extractor\common.py", line 326, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\YoutubeDL.py", line 1860, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "C:\Python27\lib\urllib2.py", line 431, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 449, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
result = func(_args)
File "c:\cygwin\usr\local\bin\youtube-dl\youtube_dl\utils.py", line 749, in https_open
req, *_kwargs)
File "C:\Python27\lib\urllib2.py", line 1194, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "C:\Python27\lib\httplib.py", line 1053, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1093, in _send_request
self.endheaders(body)
File "C:\Python27\lib\httplib.py", line 1049, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 893, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 855, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 1266, in connect
HTTPConnection.connect(self)
File "C:\Python27\lib\httplib.py", line 835, in connect
self._tunnel()
File "C:\Python27\lib\httplib.py", line 819, in _tunnel
line = response.fp.readline(_MAXLINE + 1)
TypeError: readline() takes exactly 1 argument (2 given)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 1, 2015

I can reproduce this as well. It's a python issue.

@dstftw dstftw closed this in e5e7879 Sep 2, 2015
dstftw added a commit that referenced this issue Sep 2, 2015
[utils] Strict HTTP responses (Closes #6727)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.