Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashlib module fails with TypeError #45459

Closed
dripton mannequin opened this issue Sep 6, 2007 · 2 comments
Closed

hashlib module fails with TypeError #45459

dripton mannequin opened this issue Sep 6, 2007 · 2 comments
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@dripton
Copy link
Mannequin

dripton mannequin commented Sep 6, 2007

BPO 1118
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-09-06.13:49:56.250>
created_at = <Date 2007-09-06.10:54:57.793>
labels = ['invalid', 'library', 'type-crash']
title = 'hashlib module fails with TypeError'
updated_at = <Date 2007-09-06.13:49:56.237>
user = 'https://bugs.python.org/dripton'

bugs.python.org fields:

activity = <Date 2007-09-06.13:49:56.237>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2007-09-06.13:49:56.250>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2007-09-06.10:54:57.793>
creator = 'dripton'
dependencies = []
files = []
hgrepos = []
issue_num = 1118
keywords = []
message_count = 2.0
messages = ['55687', '55691']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'dripton']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue1118'
versions = ['Python 3.0']

@dripton
Copy link
Mannequin Author

dripton mannequin commented Sep 6, 2007

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 "<stdin>", line 1, in <module>
TypeError: object supporting the buffer API required

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

@dripton dripton mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 6, 2007
@birkenfeld
Copy link
Member

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 "<stdin>", line 1, in <module>
> 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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

1 participant