-
Notifications
You must be signed in to change notification settings - Fork 40
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
update _valid_key_re #119
update _valid_key_re #119
Conversation
Reviewed-by: dongweiming <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #119 +/- ##
======================================
Coverage 91.5% 91.5%
======================================
Files 5 5
Lines 259 259
Branches 38 38
======================================
Hits 237 237
Misses 11 11
Partials 11 11
Continue to review full report at Codecov.
|
i have merged your PR to my project rexzhang@27c737d |
@@ -39,7 +39,7 @@ def __init__(self, host, port=11211, *, | |||
# key supports ascii sans space and control chars | |||
# \x21 is !, right after space, and \x7e is -, right before DEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc line needs updating.
@@ -39,7 +39,7 @@ def __init__(self, host, port=11211, *, | |||
# key supports ascii sans space and control chars | |||
# \x21 is !, right after space, and \x7e is -, right before DEL | |||
# also 1 <= len <= 250 as per the spec | |||
_valid_key_re = re.compile(b'^[\x21-\x7e]{1,250}$') | |||
_valid_key_re = re.compile(b'^[^\x00-\x20\x7f]{1,250}$') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the above comment and the memcached documention, "the key must not include
control characters or whitespace."
Therefore this will need some more work to allow non-ascii characters.
Fixed with #240 instead. |
ref: #118
Is it more appropriate to use this?