#18405 closed Cleanup/optimization (fixed)

Delay string encoding in contrib.auth.hashers

Reported by: claudep Owned by: nobody
Component: contrib.auth Version: master
Severity: Normal Keywords: python3
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As a preparation to switch to more Unicode strings on the road to Python 3, I suggest to encode strings only at the exact moment that we need encoded strings. In contrib.auth.hashers (see patch), this might produce a slightly backwards-incompatible behavior, but should affect very few users (only those having written a custom password hasher and if this hasher does not support Unicode strings).

I'm setting this as RFC, as I'm rather confident about it (all tests pass) and I'm about to push it. But I'd like to offer the time for a quick review or a stop if any strong argument would appear against it.

Attachments (1)

hashers.diff (4.5 KB) - added by claudep 23 months ago.
Delayed string encoding in hashers

Download all attachments as: .zip

Change History (2)

Changed 23 months ago by claudep

Delayed string encoding in hashers

comment:1 Changed 23 months ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.