-
Notifications
You must be signed in to change notification settings - Fork 306
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
[dogstatsd] support unicode tags 🔣 #152
Conversation
@@ -103,8 +103,8 @@ def test_tagged_gauge(self): | |||
t.assert_equal('gt:123.4|g|#country:china,age:45,blue', self.recv()) | |||
|
|||
def test_tagged_counter(self): | |||
self.statsd.increment('ct', tags=['country:canada', 'red']) | |||
t.assert_equal('ct:1|c|#country:canada,red', self.recv()) | |||
self.statsd.increment('ct', tags=[u'country:españa', 'red']) |
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.
that's right 💯
👍 |
Using unicode with DogStatsD tags causes `UnicodeDecodeError` exceptions. Do not raise on unicode tags. Fix #132.
e2ae0ff
to
ccbd94d
Compare
This doesn't seem correct to me. I'm trying to diagnose a related issue (I'll update when I do), but from a very quick read, IMHO #132 should be wontfixed and this backed out. tags should either be unicode or bytes, and the current behavior asks for bytes. This changeset will break existing tags. |
OK, it looks like the current behavior actually isn't consistent about which it's after, so I'm not sure what's intended. I can survey what the behavior is on different versions I guess after finding my own issue. This patchset is certainly assuming that everything passed to dogstatsd is unicode though (or accidentally-ASCII-encoded-bytes-on-py2). |
Hi @Julian,
Thanks! |
@yannmh I've had to switch to debugging something else, I'll try to circle back and provide more detail, but this patchset changed something from calling You can reproduce by e.g. passing in a tag of |
Using unicode with DogStatsD tags causes
UnicodeDecodeError
exceptions.
Do not raise on unicode tags. Fix #132.