--> --> -->
 
 
<class 'urllib2.HTTPError'>
Python 2.7.6: /usr/local/bin/python
Sun Sep 24 21:08:11 2017

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/mikan100yen/www/yume/ehon_uresuji.cgi in ()
     85 
     86 # 最初の10位分を取得
=>   87 ehon_data1, force_amazon = getTopSeller(1 + 2 * (page - 1))
     88 if force_amazon:
     89     time.sleep(1)
ehon_data1 undefined, force_amazon undefined, getTopSeller = <function getTopSeller>, page = 1
 /home/mikan100yen/www/yume/ehon_uresuji.cgi in getTopSeller(rank=1, force_amazon=False)
     40         # Amazonより絵本の売れ筋ランキングを取得
     41         amazon = Amazon("AKIAJ465NXSCIRK7NPVQ", "INXxA1HSKvUwLtRrcQ+u8KJYotpFDAq1y47lFYx7", ASSOCIATE_ID)
=>   42         xml = amazon.bestSellers("Books", EHON_NODE_ID, ItemPage=str(rank))  # 絵本
     43         #print amazon.url  # リクエストURL
     44         cache.save(xml);
xml undefined, amazon = <amazon.Amazon instance>, amazon.bestSellers = <bound method Amazon.bestSellers of <amazon.Amazon instance>>, global EHON_NODE_ID = '492378', ItemPage undefined, builtin str = <type 'str'>, rank = 1
 /home/mikan100yen/www/yume/amazon.py in bestSellers(self=<amazon.Amazon instance>, search_index='Books', node_id='492378', **options={'BrowseNode': '492378', 'ItemPage': '1', 'ResponseGroup': 'ItemAttributes,Images', 'Sort': 'salesrank'})
     50         options["Sort"] = "salesrank"
     51         options["ResponseGroup"] = "ItemAttributes,Images"
=>   52         return self.itemSearch(search_index, **options)
     53     
     54     def topSellers(self, node_id, **options):
self = <amazon.Amazon instance>, self.itemSearch = <bound method Amazon.itemSearch of <amazon.Amazon instance>>, search_index = 'Books', options = {'BrowseNode': '492378', 'ItemPage': '1', 'ResponseGroup': 'ItemAttributes,Images', 'Sort': 'salesrank'}
 /home/mikan100yen/www/yume/amazon.py in itemSearch(self=<amazon.Amazon instance>, search_index='Books', **options={'AWSAccessKeyId': 'AKIAJ465NXSCIRK7NPVQ', 'AssociateTag': 'amznjsbx0-22', 'BrowseNode': '492378', 'ItemPage': '1', 'Operation': 'ItemSearch', 'ResponseGroup': 'ItemAttributes,Images', 'SearchIndex': 'Books', 'Service': 'AWSECommerceService', 'Sort': 'salesrank', 'Timestamp': '2017-09-24T12:08:11Z'})
     43         params["Operation"] = "ItemSearch"
     44         params["SearchIndex"] = search_index
=>   45         return self.sendRequest(params)
     46     
     47     def bestSellers(self, search_index, node_id, **options):
self = <amazon.Amazon instance>, self.sendRequest = <bound method Amazon.sendRequest of <amazon.Amazon instance>>, params = {'AWSAccessKeyId': 'AKIAJ465NXSCIRK7NPVQ', 'AssociateTag': 'amznjsbx0-22', 'BrowseNode': '492378', 'ItemPage': '1', 'Operation': 'ItemSearch', 'ResponseGroup': 'ItemAttributes,Images', 'SearchIndex': 'Books', 'Service': 'AWSECommerceService', 'Sort': 'salesrank', 'Timestamp': '2017-09-24T12:08:11Z'}
 /home/mikan100yen/www/yume/amazon.py in sendRequest(self=<amazon.Amazon instance>, params={'AWSAccessKeyId': 'AKIAJ465NXSCIRK7NPVQ', 'AssociateTag': 'amznjsbx0-22', 'BrowseNode': '492378', 'ItemPage': '1', 'Operation': 'ItemSearch', 'ResponseGroup': 'ItemAttributes,Images', 'SearchIndex': 'Books', 'Service': 'AWSECommerceService', 'Sort': 'salesrank', 'Timestamp': '2017-09-24T12:08:11Z'})
     96         else:
     97             opener = urllib2.build_opener()
=>   98         return opener.open(self.url).read()
     99 
    100 
opener = <urllib2.OpenerDirector instance>, opener.open = <bound method OpenerDirector.open of <urllib2.OpenerDirector instance>>, self = <amazon.Amazon instance>, self.url = 'http://webservices.amazon.co.jp/onca/xml?AWSAcce...re=dgshSO7vptasZa8lGAiBprCRScs15H91r21Ee2Yaq4w%3D', ).read undefined
 /usr/local/lib/python2.7/urllib2.py in open(self=<urllib2.OpenerDirector instance>, fullurl='http://webservices.amazon.co.jp/onca/xml?AWSAcce...re=dgshSO7vptasZa8lGAiBprCRScs15H91r21Ee2Yaq4w%3D', data=None, timeout=<object object>)
    408         for processor in self.process_response.get(protocol, []):
    409             meth = getattr(processor, meth_name)
=>  410             response = meth(req, response)
    411 
    412         return response
response = <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, meth = <bound method HTTPErrorProcessor.http_response of <urllib2.HTTPErrorProcessor instance>>, req = <urllib2.Request instance>
 /usr/local/lib/python2.7/urllib2.py in http_response(self=<urllib2.HTTPErrorProcessor instance>, request=<urllib2.Request instance>, response=<addinfourl at 34388800504 whose fp = <socket._fileobject object>>)
    521         if not (200 <= code < 300):
    522             response = self.parent.error(
=>  523                 'http', request, response, code, msg, hdrs)
    524 
    525         return response
request = <urllib2.Request instance>, response = <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, code = 503, msg = 'Service Unavailable', hdrs = <httplib.HTTPMessage instance>
 /usr/local/lib/python2.7/urllib2.py in error(self=<urllib2.OpenerDirector instance>, proto=503, *args=({301: [<urllib2.HTTPRedirectHandler instance>], 302: [<urllib2.HTTPRedirectHandler instance>], 303: [<urllib2.HTTPRedirectHandler instance>], 307: [<urllib2.HTTPRedirectHandler instance>], 'default': [<urllib2.HTTPDefaultErrorHandler instance>]}, 'default', 'http_error_default', <urllib2.Request instance>, <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, 503, 'Service Unavailable', <httplib.HTTPMessage instance>))
    446         if http_err:
    447             args = (dict, 'default', 'http_error_default') + orig_args
=>  448             return self._call_chain(*args)
    449 
    450 # XXX probably also want an abstract factory that knows when it makes
self = <urllib2.OpenerDirector instance>, self._call_chain = <bound method OpenerDirector._call_chain of <urllib2.OpenerDirector instance>>, args = ({301: [<urllib2.HTTPRedirectHandler instance>], 302: [<urllib2.HTTPRedirectHandler instance>], 303: [<urllib2.HTTPRedirectHandler instance>], 307: [<urllib2.HTTPRedirectHandler instance>], 'default': [<urllib2.HTTPDefaultErrorHandler instance>]}, 'default', 'http_error_default', <urllib2.Request instance>, <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, 503, 'Service Unavailable', <httplib.HTTPMessage instance>)
 /usr/local/lib/python2.7/urllib2.py in _call_chain(self=<urllib2.OpenerDirector instance>, chain={301: [<urllib2.HTTPRedirectHandler instance>], 302: [<urllib2.HTTPRedirectHandler instance>], 303: [<urllib2.HTTPRedirectHandler instance>], 307: [<urllib2.HTTPRedirectHandler instance>], 'default': [<urllib2.HTTPDefaultErrorHandler instance>]}, kind='default', meth_name='http_error_default', *args=(<urllib2.Request instance>, <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, 503, 'Service Unavailable', <httplib.HTTPMessage instance>))
    380             func = getattr(handler, meth_name)
    381 
=>  382             result = func(*args)
    383             if result is not None:
    384                 return result
result undefined, func = <bound method HTTPDefaultErrorHandler.http_error...lt of <urllib2.HTTPDefaultErrorHandler instance>>, args = (<urllib2.Request instance>, <addinfourl at 34388800504 whose fp = <socket._fileobject object>>, 503, 'Service Unavailable', <httplib.HTTPMessage instance>)
 /usr/local/lib/python2.7/urllib2.py in http_error_default(self=<urllib2.HTTPDefaultErrorHandler instance>, req=<urllib2.Request instance>, fp=<addinfourl at 34388800504 whose fp = <socket._fileobject object>>, code=503, msg='Service Unavailable', hdrs=<httplib.HTTPMessage instance>)
    529 class HTTPDefaultErrorHandler(BaseHandler):
    530     def http_error_default(self, req, fp, code, msg, hdrs):
=>  531         raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    532 
    533 class HTTPRedirectHandler(BaseHandler):
global HTTPError = <class 'urllib2.HTTPError'>, req = <urllib2.Request instance>, req.get_full_url = <bound method Request.get_full_url of <urllib2.Request instance>>, code = 503, msg = 'Service Unavailable', hdrs = <httplib.HTTPMessage instance>, fp = <addinfourl at 34388800504 whose fp = <socket._fileobject object>>

<class 'urllib2.HTTPError'>: HTTP Error 503: Service Unavailable
      args = ()
      close = <bound method HTTPError.close of HTTPError()>
      code = 503
      errno = None
      filename = 'http://webservices.amazon.co.jp/onca/xml?AWSAcce...re=dgshSO7vptasZa8lGAiBprCRScs15H91r21Ee2Yaq4w%3D'
      fileno = <bound method _fileobject.fileno of <socket._fileobject object>>
      fp = <addinfourl at 34388800504 whose fp = <socket._fileobject object>>
      getcode = <bound method HTTPError.getcode of HTTPError()>
      geturl = <bound method HTTPError.geturl of HTTPError()>
      hdrs = <httplib.HTTPMessage instance>
      headers = <httplib.HTTPMessage instance>
      info = <bound method HTTPError.info of HTTPError()>
      message = ''
      msg = 'Service Unavailable'
      next = <bound method _fileobject.next of <socket._fileobject object>>
      read = <bound method _fileobject.read of <socket._fileobject object>>
      readline = <bound method _fileobject.readline of <socket._fileobject object>>
      readlines = <bound method _fileobject.readlines of <socket._fileobject object>>
      reason = 'Service Unavailable'
      strerror = None
      url = 'http://webservices.amazon.co.jp/onca/xml?AWSAcce...re=dgshSO7vptasZa8lGAiBprCRScs15H91r21Ee2Yaq4w%3D'