redtoad / python-amazon-product-api

A Python wrapper for the Amazon Product Advertising API. This module offers a light-weight access to the latest version of the Amazon Product Advertising API without getting in your way.
https://pypi.org/project/python-amazon-product-api/
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Running the library under Python 2.4 fails #13

Closed redtoad closed 14 years ago

redtoad commented 14 years ago

Originally reported by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


Tried python2.4 setup.py test and gut:

#!pytb

Traceback (most recent call last):
  File "/tmp/python-amazon-product-api/tests/test-api-basics.py", line 47, in test_fails_for_too_many_requests
    ResponseGroup='???')
  File "/usr/lib/python2.4/unittest.py", line 320, in failUnlessRaises
    callableObj(*args, **kwargs)
  File "/tmp/python-amazon-product-api/amazonproduct.py", line 446, in item_lookup
    url = self._build_url(Operation='ItemLookup', ItemId=id, **params)
  File "/tmp/python-amazon-product-api/amazonproduct.py", line 347, in _build_url
    args = '&'.join('%s=%s' % (key, urllib2.quote(str(qargs[key])))
  File "/tmp/python-amazon-product-api/amazonproduct.py", line 347, in <generator expression>
    args = '&'.join('%s=%s' % (key, urllib2.quote(str(qargs[key])))
AttributeError: 'module' object has no attribute 'quote'

redtoad commented 14 years ago

Original comment by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


Bugfix: API works under Python 2.4 again (fixes #13).

redtoad commented 14 years ago

Original comment by Anonymous


I too found the same problem. You can work around it as follows:

import amazonproduct import urllib amazonproduct.urllib2.quote = urllib.quote