new is missing in module hmac SHA-based encryption function in Python

Chris Mellon arkanes at gmail.com
Wed Nov 21 12:32:31 EST 2007


On Nov 21, 2007 10:50 AM, Matt Nordhoff <mnordhoff at mattnordhoff.com> wrote:
> Hailong Wang wrote:
> > Matt,
> >
> > Thanks for response, I changed my script to hw_hmac.py, but still does
> > not work.
> >
> > Traceback (most recent call last):
> >   File "C:/Python25/hw_script/my_hmac.py", line 1, in <module>
> >     import hmac
> >   File "C:\Python25\hw_script\hmac.py", line 4, in <module>
> >     myhmac = hmac.new("test")
> > AttributeError: 'module' object has no attribute 'new'
> >>>>
>
> (Note to anyone else: He responded off-list saying he got it to work. :-) )
>

And for the information of anyone searching the list archives: The
problem was almost certainly that while he'd renamed hmac.py, hmac.pyc
was still around.

> --
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list