-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes issues with security.create_token() and Unicode problems #4
Open
gorakhargosh
wants to merge
11
commits into
moraes:master
Choose a base branch
from
gorakhargosh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
* 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 <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
* 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 <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
* Everything in a single module seems fine for a start but gets unweildy very fast. Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
Signed-off-by: Gora Khargosh <[email protected]>
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
, andbasestring
mean differentthings to Python 2.5, 2.6, and 3.x.
Python 2.5
bytes
is not available.str
is a byte string.unicode
converts to unicode string.basestring
exists.Python 2.6
bytes
is available and maps to strstr
is a byte string.unicode
converts to unicode stringbasestring
exists.Python 3.x
bytes
is available and does not map tostr
.str
maps to the earlierunicode
, butunicode
has been removed.basestring
has been removed.unicode
has 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:
bytes
where you need byte strings.unicode_string
where you need unicode stringscomplications behind type checking therefore cleaning
up the code base.
hexadecimal string.
bytes
is 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 [email protected]