This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test.test_hashlib.HashLibTestCase fails on darwin
Type: Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ebfe, gregory.p.smith, pitrou, tarek
Priority: normal Keywords:

Created on 2009-02-13 13:43 by tarek, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg81925 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-02-13 13:43
The check_no_unicode('md5') fails under darwin (in the trunk)

(Pdb) hashlib.md5(u'spam')       <--- suppose to raise a TypeError here
<md5 HASH object @ 0x6926b8>
(Pdb) hashlib.md5('spam') 
<md5 HASH object @ 0x692610>


traceback :

======================================================================
FAIL: test_no_unicode (test.test_hashlib.HashLibTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/Volumes/MacDev/svn.python.org/python-trunk2/Lib/test/test_hashlib.py",
line 75, in test_no_unicode
    self.check_no_unicode('md5')
  File
"/Volumes/MacDev/svn.python.org/python-trunk2/Lib/test/test_hashlib.py",
line 71, in check_no_unicode
    self.assertRaises(TypeError, getattr(hashlib, algorithm_name), u'spam')
AssertionError: TypeError not raised
msg81933 - (view) Author: Lukas Lueg (ebfe) Date: 2009-02-13 14:17
test_case_md5_0 (__main__.HashLibTestCase) ... ok
test_case_md5_1 (__main__.HashLibTestCase) ... ok
test_case_md5_2 (__main__.HashLibTestCase) ... ok
test_case_md5_huge (__main__.HashLibTestCase) ... ok
test_case_md5_uintmax (__main__.HashLibTestCase) ... ok
test_case_sha1_0 (__main__.HashLibTestCase) ... ok
test_case_sha1_1 (__main__.HashLibTestCase) ... ok
test_case_sha1_2 (__main__.HashLibTestCase) ... ok
test_case_sha1_3 (__main__.HashLibTestCase) ... ok
test_case_sha224_0 (__main__.HashLibTestCase) ... ok
test_case_sha224_1 (__main__.HashLibTestCase) ... ok
test_case_sha224_2 (__main__.HashLibTestCase) ... ok
test_case_sha224_3 (__main__.HashLibTestCase) ... ok
test_case_sha256_0 (__main__.HashLibTestCase) ... ok
test_case_sha256_1 (__main__.HashLibTestCase) ... ok
test_case_sha256_2 (__main__.HashLibTestCase) ... ok
test_case_sha256_3 (__main__.HashLibTestCase) ... ok
test_case_sha384_0 (__main__.HashLibTestCase) ... ok
test_case_sha384_1 (__main__.HashLibTestCase) ... ok
test_case_sha384_2 (__main__.HashLibTestCase) ... ok
test_case_sha384_3 (__main__.HashLibTestCase) ... ok
test_case_sha512_0 (__main__.HashLibTestCase) ... ok
test_case_sha512_1 (__main__.HashLibTestCase) ... ok
test_case_sha512_2 (__main__.HashLibTestCase) ... ok
test_case_sha512_3 (__main__.HashLibTestCase) ... ok
test_hexdigest (__main__.HashLibTestCase) ... ok
test_large_update (__main__.HashLibTestCase) ... ok
test_no_unicode (__main__.HashLibTestCase) ... ok
test_unknown_hash (__main__.HashLibTestCase) ... ok

----------------------------------------------------------------------
Ran 29 tests in 0.399s

OK
[22842 refs]


mac-lueg:py27 llueg$ ./python.exe 
Python 2.7a0 (trunk:69584, Feb 13 2009, 15:12:58) 
[GCC 4.0.1 (Apple Inc. build 5484)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
[36860 refs]
>>> hashlib.md5(u'spam')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Unicode-objects must be encoded before hashing
[36893 refs]
msg81936 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-02-13 14:40
I have rebuilt a fresh trunk from scratch and it is not reproductible
anymore. It was my environment with no doubt.
msg81937 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-13 14:41
Perhaps it's because of missing dependencies in the Makefile?
(just trying to guess)
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49496
2009-02-13 14:42:00pitrousetnosy: + pitrou
messages: + msg81937
2009-02-13 14:40:48tareksetstatus: open -> closed
resolution: not a bug
messages: + msg81936
2009-02-13 14:18:00ebfesetmessages: + msg81933
2009-02-13 14:03:54pitrousetnosy: + gregory.p.smith, ebfe
2009-02-13 13:43:24tarekcreate