Skip to content
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

Unicode Characters in Tags Cause Problems #132

Closed
cshoe opened this issue Mar 29, 2016 · 1 comment
Closed

Unicode Characters in Tags Cause Problems #132

cshoe opened this issue Mar 29, 2016 · 1 comment
Assignees
Milestone

Comments

@cshoe
Copy link

cshoe commented Mar 29, 2016

Seen in datadogpy 0.9.0 and 0.11.0 using Python 2.7.6 and 2.7.11.

It doesn't seem possible to use unicode characters in tags. Running the following causes an UnicodeDecodeError to be raised from the use of str here:

# -*- coding: utf-8 -*-

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

from datadog import statsd

statsd.increment('tagged_counter', 1, tags=['person:Jóhn', 'foo:bar'])

If the tags are encoded before they are sent to datadogpy, the error is raised in 0.11.0 a couple lines before when the payload is being constructed.

# -*- coding: utf-8 -*-

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

from datadog import statsd

statsd.increment('tagged_counter', 1, tags=['person:Jóhn'.encode('utf-8'), 'foo:bar'])
@yannmh yannmh added this to the 0.12.0 milestone Mar 30, 2016
@yannmh
Copy link
Member

yannmh commented Mar 30, 2016

Thanks for reporting the issue @cshoe.

I am adding it to our 0.12.0 milestone, so it gets fixed in the next release.

@yannmh yannmh self-assigned this Mar 30, 2016
@yannmh yannmh modified the milestones: 0.12.0, 0.13.0 May 26, 2016
yannmh added a commit that referenced this issue Aug 24, 2016
Using unicode with DogStatsD tags causes `UnicodeDecodeError`
exceptions.

Do not raise on unicode tags. Fix #132.
yannmh added a commit that referenced this issue Aug 24, 2016
Using unicode with DogStatsD tags causes `UnicodeDecodeError`
exceptions.

Do not raise on unicode tags. Fix #132.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants