Bug 917380 - [abrt] youtube-dl-2013.01.13-1.fc18: urllib2.py:1177:do_open:URLError: <urlopen error [Errno -2] Name or service not known>
Summary: [abrt] youtube-dl-2013.01.13-1.fc18: urllib2.py:1177:do_open:URLError: <urlop...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: youtube-dl
Version: 18
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Christopher Meng
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/rg3/youtube-dl/iss...
Whiteboard: abrt_hash:c58943f4a724d72a5d20f84ae6b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-03 18:09 UTC by Alexandre Moine
Modified: 2013-08-07 03:45 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-06 05:15:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.98 KB, text/plain)
2013-03-03 18:09 UTC, Alexandre Moine
no flags Details
File: core_backtrace (1.05 KB, text/plain)
2013-03-03 18:09 UTC, Alexandre Moine
no flags Details
File: environ (3.07 KB, text/plain)
2013-03-03 18:10 UTC, Alexandre Moine
no flags Details

Description Alexandre Moine 2013-03-03 18:09:09 UTC
Description of problem:
I specify an inexistant URL (http://abc), for test a script.
The command (youtube-dl http://abc)  return: 

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/bin/youtube-dl/__main__.py", line 17, in <module>
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 494, in main
    
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 478, in _real_main
    
  File "/usr/bin/youtube-dl/youtube_dl/FileDownloader.py", line 503, in download
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 92, in extract
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 1301, in _real_extract
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 1290, in _test_redirect
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

Thank's

Version-Release number of selected component:
youtube-dl-2013.01.13-1.fc18

Additional info:
cmdline:        python /usr/bin/youtube-dl -x --audio-format vorbis -t http://abc
dso_list:       python-libs-2.7.3-13.fc18.i686
executable:     /usr/bin/youtube-dl
kernel:         3.7.9-205.fc18.i686
uid:            1000

Truncated backtrace:
urllib2.py:1177:do_open:URLError: <urlopen error [Errno -2] Name or service not known>

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/bin/youtube-dl/__main__.py", line 17, in <module>
    youtube_dl.main()
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 494, in main
    _real_main()
  File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 478, in _real_main
    retcode = fd.download(all_urls)
  File "/usr/bin/youtube-dl/youtube_dl/FileDownloader.py", line 503, in download
    videos = ie.extract(url)
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 92, in extract
    return self._real_extract(url)
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 1301, in _real_extract
    if self._test_redirect(url): return
  File "/usr/bin/youtube-dl/youtube_dl/InfoExtractors.py", line 1290, in _test_redirect
    response = opener.open(HeadRequest(url))
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -2] Name or service not known>

Local variables in innermost frame:
err: gaierror(-2, 'Name or service not known')
h: <httplib.HTTPConnection instance at 0x9413f0c>
self: <urllib2.HTTPHandler instance at 0x93261ac>
req: <youtube_dl.InfoExtractors.HeadRequest instance at 0x93261ec>
headers: {'Host': 'abc', 'Connection': 'close', 'User-Agent': 'Python-urllib/2.7'}
host: 'abc'
http_class: <class httplib.HTTPConnection at 0x924f0ec>

Comment 1 Alexandre Moine 2013-03-03 18:09:26 UTC
Created attachment 704603 [details]
File: backtrace

Comment 2 Alexandre Moine 2013-03-03 18:09:53 UTC
Created attachment 704604 [details]
File: core_backtrace

Comment 3 Alexandre Moine 2013-03-03 18:10:02 UTC
Created attachment 704605 [details]
File: environ

Comment 4 Fedora Admin XMLRPC Client 2013-05-09 09:29:18 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Christopher Meng 2013-05-09 09:35:47 UTC
Hi,

Have you tried the newer version?

Does it still happen?

Comment 6 Michael Schwendt 2013-08-05 11:18:20 UTC
Easily reproducible.

$ rpm -q youtube-dl
youtube-dl-2013.08.02-1.fc19.noarch
$ youtube-dl http://abc
Traceback (most recent call last):
 [...]
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
$

and ABRT kicks in.

Comment 7 Christopher Meng 2013-08-06 05:15:07 UTC
Hi reporter, next time please try a valid URL to play with.

Comment 8 Michael Schwendt 2013-08-06 08:13:35 UTC
> raise URLError(err)

Well, if you're in contact with upstream, typically one would catch such an exception and handle it properly instead of letting the Python program crash.

Note that this will return any time another user makes a typo or uses an URL that triggers the same exception.

Comment 9 Alexandre Moine 2013-08-06 14:50:33 UTC
Hi, thank's for your reply.

I report this bug especially for developers, so they treat this exception. It isn't very friendly when, after a typo, the automatic bug reporting tool start.

Comment 10 Michael Schwendt 2013-08-06 17:14:15 UTC
Exactly. Since I happened to have a github account and believe the youtube-dl developer might be interested in catching such exceptions, I've opened issue #1194 (should catch urllib2.URLError exceptions instead of crashing).


Note You need to log in before you can comment on or make changes to this bug.