[issue1118] hashlib module fails with TypeError

2007-09-06 Thread Georg Brandl

Georg Brandl added the comment:

David Ripton schrieb:
> New submission from David Ripton:
> 
> The hashlib module seems not to work at all:
> 
> $ python3.0
> Python 3.0a1 (py3k, Sep  5 2007, 08:17:11)
> [GCC 4.1.2 (Gentoo 4.1.2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
 import hashlib
 m = hashlib.md5()
 m.update("Nobody inspects")
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: object supporting the buffer API required

hashlib only accepts bytes for its digests, since the algorithms work
on bytes, not characters.

Unfortunately, this isn't documented yet, but I'll do that now.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1118] hashlib module fails with TypeError

2007-09-06 Thread David Ripton

New submission from David Ripton:

The hashlib module seems not to work at all:

$ python3.0
Python 3.0a1 (py3k, Sep  5 2007, 08:17:11)
[GCC 4.1.2 (Gentoo 4.1.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> m = hashlib.md5()
>>> m.update("Nobody inspects")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object supporting the buffer API required

(Same error with hashlib.sha1(), etc.)

--
components: Library (Lib)
messages: 55687
nosy: dripton
severity: normal
status: open
title: hashlib module fails with TypeError
type: crash
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com