Skip to content

Unicode Characters in Tags Cause Problems #132

@cshoe

Description

@cshoe

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'])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions