forked from Pylons/pyramid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the wiki2 tutorial to set the password as unicode
Something really weird is happening but this fixes it. SQLAlchemy is returning the "password_hash" from queries as the type that it was inserted as. Not consistently unicode or bytes. If I insert bytes, then I get bytes back out. If I insert unicode then I get unicode back out. It's unclear why, as the type is Text, the data we're storing is unambiguously US-ASCII and the connection is using a consistent text_factory for unicode conversions of "str" on Python 3. Here, we ensure that we always insert the value as unicode which appears to fix downstream issues like those mentioned in Pylons#2605. I was able to reproduce that bug and confirm this fixes it if the original database is initialized using this fix. Obsoletes Pylons#2623.
- Loading branch information
Showing
5 changed files
with
10 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters