Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 900819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:27:11+00:00 2026-05-15T15:27:11+00:00

So I have some code: signature = hmac.new( key=AWS_SECRET_ACCESS_KEY, msg=string_to_sign, digestmod=hashlib.sha256).digest() That runs perfectly

  • 0

So I have some code:

signature = hmac.new(
    key=AWS_SECRET_ACCESS_KEY,
    msg=string_to_sign,
    digestmod=hashlib.sha256).digest()

That runs perfectly on my own computer (has python 2.6.1). However, when I run this code on my server (Python 2.4.3) I get the following:

 /home/MYUSERNAME/public_html/Foo.com/cgi-bin/foo.py
   66     key=AWS_SECRET_ACCESS_KEY,
   67     msg=string_to_sign,
   68     digestmod=hashlib.sha1).digest()
   69  
   70 # Base64 encode the signature
digestmod = <built-in function openssl_sha256>, hashlib = <module 'hashlib' from '/usr/lib/python2.4/site-...shlib-20081119-py2.4-linux-i686.egg/hashlib.pyc'>, hashlib.sha1 = <built-in function openssl_sha1>, ).digest undefined
 /usr/lib/python2.4/hmac.py in new(key='xR6MsC/+Vc2xkd0YYbER0meR/IkWEU', msg='GET\necs.amazonaws.com\n/onca/xml\nAWSAccessKeyId=A...CommerceService&Timestamp=2010-07-03T18%3A56%3A48', digestmod=<built-in function openssl_sha1>)
  103     You can now feed arbitrary strings into the object using its update()
  104     method, and can ask for the hash value at any time by calling its digest()
  105     method.
  106     """
  107     return HMAC(key, msg, digestmod)
global HMAC = <class hmac.HMAC>, key = 'xR6MsC/+Vc2xkd0YYbER0meR/IkWEU', msg = 'GET\necs.amazonaws.com\n/onca/xml\nAWSAccessKeyId=A...CommerceService&Timestamp=2010-07-03T18%3A56%3A48', digestmod = <built-in function openssl_sha1>
 /usr/lib/python2.4/hmac.py in __init__(self=<hmac.HMAC instance>, key='xR6MsC/+Vc2xkd0YYbER0meR/IkWEU', msg='GET\necs.amazonaws.com\n/onca/xml\nAWSAccessKeyId=A...CommerceService&Timestamp=2010-07-03T18%3A56%3A48', digestmod=<built-in function openssl_sha1>)
   40 
   41         self.digestmod = digestmod
   42         self.outer = digestmod.new()
   43         self.inner = digestmod.new()
   44         self.digest_size = digestmod.digest_size
self = <hmac.HMAC instance>, self.outer undefined, digestmod = <built-in function openssl_sha1>, digestmod.new undefined

AttributeError: 'builtin_function_or_method' object has no attribute 'new'
      args = ("'builtin_function_or_method' object has no attribute 'new'",) 

I know the obvious response is to just update Python on my server, but my host has to do that and I don;t know how long it’ll take. I’m just curious if this is a common/known issue on 2.4.3 or if something else is going on.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:27:11+00:00Added an answer on May 15, 2026 at 3:27 pm

    hashlib is new in 2.5. You’ll need the backport for older versions of Python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code like this: If key.Equals(search, StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I
I have some code in a javascript file that needs to send queries back
I have some code that gives a user id to a utility that then
I have some code that relied on methods not being inlined : internal class
I have some code that I had to write to replace a function that
I have a custom plugin for 3ds Max that interfaces with some managed code
I have some C code that compiles to a DLL. From C#, I need
I have some code that retrieves some xml then tries to verify the xml
I have a some simple Java code that looks similar to this in its
In C++ I have some code that requires a const char * to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.