HTTPError

HTTP Error 404: Not Found search by Google

args : tuple
()
code : int
404
errno : NoneType
None
filename : str
http://turnaje.4fan.cz/news.php
fp : instance
<addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>
hdrs : instance
Date: Sat, 22 Jun 2013 21:29:02 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Content-Length: 5726 Connection: close Content-Type: text/html
headers : instance
Date: Sat, 22 Jun 2013 21:29:02 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Content-Length: 5726 Connection: close Content-Type: text/html
message : str
msg : str
Not Found
strerror : NoneType
None
url : str
http://turnaje.4fan.cz/news.php

Traceback

  1. \bug\bsoup.py in <module> (arguments )

    1. exception_hook.enable()
    2. # <title="počítadlo přístupů:="" pocitadlo.abz.cz=""></title="počítadlo>
    3. # url = "http://tuberadio.6f.sk/"
    4. # BOM before DOCTYPE
    5. url = "http://turnaje.4fan.cz/news.php"
    6. page = urllib2.urlopen(url)
    7. soup = BeautifulSoup(page.read())
    8. page.close()
    9. html = str(soup)

    Locals

    BeautifulSoup : type
    <class 'BeautifulSoup.BeautifulSoup'>
    exception_hook : _ExceptionHook
    <diagnostics._ExceptionHook object at 0x00C9FB10>
    url : str
    http://turnaje.4fan.cz/news.php
    urllib2 : module
    <module 'urllib2' from '\Python2.6\lib\urllib2.pyc'>

    Globals

    exception_hook : _ExceptionHook
    <diagnostics._ExceptionHook object at 0x00C9FB10>
    url : str
    http://turnaje.4fan.cz/news.php
  2. \Python2.6\lib\urllib2.py in urlopen (arguments )

    url : str
    http://turnaje.4fan.cz/news.php
    data : NoneType
    None
    timeout : object
    <object object at 0x00AA14C8>
    1. _opener = None
    2. def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
    3. global _opener
    4. if _opener is None:
    5. _opener = build_opener()
    6. return _opener.open(url, data, timeout)
    7. def install_opener(opener):
    8. global _opener
    9. _opener = opener

    Locals

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>
  3. \Python2.6\lib\urllib2.py in open (arguments )

    self : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    fullurl : str
    http://turnaje.4fan.cz/news.php
    data : NoneType
    None
    timeout : object
    <object object at 0x00AA14C8>
    1. # post-process response
    2. meth_name = protocol+"_response"
    3. for processor in self.process_response.get(protocol, []):
    4. meth = getattr(processor, meth_name)
    5. response = meth(req, response)
    6. return response
    7. def _open(self, req, data=None):

    Locals

    meth : instancemethod
    <bound method HTTPErrorProcessor.http_response of <urllib2.HTTPErrorProcessor instance at 0x00D5BD28>>
    meth_name : str
    http_response
    processor : instance
    <urllib2.HTTPErrorProcessor instance at 0x00D5BD28>
    protocol : str
    http
    req : instance
    <urllib2.Request instance at 0x00D5BE18>
    response : instance
    <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>
  4. \Python2.6\lib\urllib2.py in http_response (arguments )

    self : instance
    <urllib2.HTTPErrorProcessor instance at 0x00D5BD28>
    request : instance
    <urllib2.Request instance at 0x00D5BE18>
    response : instance
    <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>
    1. # According to RFC 2616, "2xx" code indicates that the client's
    2. # request was successfully received, understood, and accepted.
    3. if not (200 <= code < 300):
    4. response = self.parent.error(
    5. 'http', request, response, code, msg, hdrs)
    6. return response
    7. https_response = http_response

    Locals

    code : int
    404
    hdrs : instance
    Date: Sat, 22 Jun 2013 21:29:02 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Content-Length: 5726 Connection: close Content-Type: text/html
    msg : str
    Not Found

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>
  5. \Python2.6\lib\urllib2.py in error (arguments )

    self : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    proto : int
    404
    *args : tuple
    ({'default': [<urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>], 307: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 301: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 302: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 303: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>]}, 'default', 'http_error_default', <urllib2.Request instance at 0x00D5BE18>, <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>, 404, 'Not Found', <httplib.HTTPMessage instance at 0x00D5D490>)
    1. if result:
    2. return result
    3. if http_err:
    4. args = (dict, 'default', 'http_error_default') + orig_args
    5. return self._call_chain(*args)
    6. # XXX probably also want an abstract factory that knows when it makes
    7. # sense to skip a superclass in favor of a subclass and when it might
    8. # make sense to include both

    Locals

    dict : dict
    {'default': [<urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>], 307: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 301: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 302: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 303: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>]}
    http_err : int
    1
    meth_name : str
    http_error_404
    orig_args : tuple
    (<urllib2.Request instance at 0x00D5BE18>, <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>, 404, 'Not Found', <httplib.HTTPMessage instance at 0x00D5D490>)
    result : NoneType
    None

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>
  6. \Python2.6\lib\urllib2.py in _call_chain (arguments )

    self : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    chain : dict
    {'default': [<urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>], 307: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 301: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 302: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>], 303: [<urllib2.HTTPRedirectHandler instance at 0x00D5B9E0>]}
    kind : str
    default
    meth_name : str
    http_error_default
    *args : tuple
    (<urllib2.Request instance at 0x00D5BE18>, <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>, 404, 'Not Found', <httplib.HTTPMessage instance at 0x00D5D490>)
    1. # could. Otherwise, they return the response.
    2. handlers = chain.get(kind, ())
    3. for handler in handlers:
    4. func = getattr(handler, meth_name)
    5. result = func(*args)
    6. if result is not None:
    7. return result
    8. def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):

    Locals

    func : instancemethod
    <bound method HTTPDefaultErrorHandler.http_error_default of <urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>>
    handler : instance
    <urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>
    handlers : list
    [<urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>]

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>
  7. \Python2.6\lib\urllib2.py in http_error_default (arguments )

    self : instance
    <urllib2.HTTPDefaultErrorHandler instance at 0x00D5BA58>
    req : instance
    <urllib2.Request instance at 0x00D5BE18>
    fp : instance
    <addinfourl at 14012544 whose fp = <socket._fileobject object at 0x00D6E9B0>>
    code : int
    404
    msg : str
    Not Found
    hdrs : instance
    Date: Sat, 22 Jun 2013 21:29:02 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Content-Length: 5726 Connection: close Content-Type: text/html
    1. https_response = http_response
    2. class HTTPDefaultErrorHandler(BaseHandler):
    3. def http_error_default(self, req, fp, code, msg, hdrs):
    4. raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    5. class HTTPRedirectHandler(BaseHandler):
    6. # maximum number of redirections to any single URL
    7. # this is needed because of the state that cookies introduce

    Locals

    Globals

    _cut_port_re : SRE_Pattern
    <_sre.SRE_Pattern object at 0x00C010E0>
    _opener : instance
    <urllib2.OpenerDirector instance at 0x00C9A440>
    StringIO : builtin_function_or_method
    <built-in function StringIO>

Environment

Time of report generation
2013-06-22 23:29:02
Python version
2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
Path to executable
\Python2.6\py26.exe
Working directory
\bug
Arguments vector
  1. bsoup.py