Opened 19 years ago
Closed 18 years ago
#3604 closed (fixed)
Use hashlib if running under Python 2.5
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Keywords: | hashlib, sha1, md5, sprintsept14 | |
| Cc: | treborhudson@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
This was discussed here:
http://groups.google.com/group/django-developers/browse_thread/thread/d5f0951f47889770/4cb8257b8d4d8c28
Python 2.5 has deprecated the use of the sha1 and md5 modules in favor of the hashlib module. A patch will be following that implements django.contrib.auth.models methods using hashlib.
Attachments (1)
Change History (6)
by , 19 years ago
| Attachment: | hashlib.diff added |
|---|
comment:1 by , 19 years ago
| Cc: | added |
|---|---|
| Has patch: | set |
comment:2 by , 19 years ago
| Keywords: | hashlib sha1 md5 added |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:3 by , 18 years ago
| Keywords: | sprintsept14 added |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
comment:5 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Possible change: instead of doing
try: # Python 2.5 has moved to using hashlib for hashing functions import hashlib ... use hashlib except ImportError: ... use old librariesdo
try: # Python 2.5 has moved to using hashlib for hashing functions import hashlib except ImportError: # Fallback ... use old libraries ... else: ... use hashlib ...Also, this test lacks explicit tests, but I think the functionality should be covered by other existing tests.