django-swiftbrowser icon indicating copy to clipboard operation
django-swiftbrowser copied to clipboard

TypeError while pressinf the (+) upload button on any container

Open luca-viggiani opened this issue 8 years ago • 1 comments

TypeError at /upload/pippo/ character mapping must return integer, None or unicode Request Method: GET Request URL: http://swift:8000/upload/pippo/ Django Version: 1.8.6 Exception Type: TypeError Exception Value: character mapping must return integer, None or unicode Exception Location: /usr/lib/python2.7/hmac.py in init, line 75 Python Executable: /usr/bin/python Python Version: 2.7.12 Python Path: ['/home/luca/.local/bin', '/home/luca/python-swiftclient', '/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/requests-2.13.0-py2.7.egg', '/home/luca/swift', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/luca/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] Server time: Di, 21 Feb 2017 11:26:45 +0100

luca-viggiani avatar Feb 21 '17 10:02 luca-viggiani

I got the same problem, HMAC requires the key to be bytes, but data is string. here's how I fix it :

  • edit views.py
  • in upload def, change

signature = hmac.new(key, hmac_body, sha1).hexdigest() to signature = hmac.new(str(key), hmac_body, sha1).hexdigest()

candraaditama avatar Aug 07 '18 17:08 candraaditama