Fixes issues with security.create_token() and Unicode problems#4
Open
gorakhargosh wants to merge 11 commits intomoraes:masterfrom
Open
Fixes issues with security.create_token() and Unicode problems#4gorakhargosh wants to merge 11 commits intomoraes:masterfrom
gorakhargosh wants to merge 11 commits intomoraes:masterfrom
Conversation
* The function can now accept a numerical base argument. * All usages have been updated to return expected hexadecimal string. * Tests have been added for decimals. * All create_token() tests pass. * ``bytes`` is a Python 2.6+ type not available in Python 2.5. This patch fixes it with a suitable replacement. Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
* You cannot name a module "json" and import "json" from within it. This import test had been failing all this time. The module has been renamed to "escape" for all the tests to work. * Stray modules (also because they are named "json") can pollute the Python namespace and cause our imports to fail. We're expecting Python's json module, but we can end up receiving a stray module named json. Therefore, we test whether we're using Python's module. * All tests now pass. Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
* Everything in a single module seems fine for a start but gets unweildy very fast. Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bytes,str,unicode, andbasestringmean differentthings to Python 2.5, 2.6, and 3.x.
Python 2.5
bytesis not available.stris a byte string.unicodeconverts to unicode string.basestringexists.Python 2.6
bytesis available and maps to strstris a byte string.unicodeconverts to unicode stringbasestringexists.Python 3.x
bytesis available and does not map tostr.strmaps to the earlierunicode, butunicodehas been removed.basestringhas been removed.unicodehas been removedThis patch adds portable support for all three versions
of Python by adding a portable types module.
All Unicode handling has been replaced to use the
functions from this module and tests pass.
It introduces these portable types that you can use
in your code:
byteswhere you need byte strings.unicode_stringwhere you need unicode stringscomplications behind type checking therefore cleaning
up the code base.
hexadecimal string.
bytesis a Python 2.6+ type not availablein Python 2.5. This patch fixes it with a suitable
replacement.
webapp2 is still small, but it doesn't necessarily mean
we can't use packages. All the existing tests pass
without affecting any existing parent projects.
This patch ensures webapp2 can be easily ported
to Python 3.x in the future as and when required.
Signed-off-by: Gora Khargosh gora.khargosh@gmail.com