python2 compatibility in graphite and statsd output
amyangfei opened this issue · comments
amyangfei commented
hi, this commit b172276 breaks the compatibility for python2
if (not self.dry_run):
s.sendall(bytes("%s\n" % metric_string, 'ascii'))
else:
print("%s %s" % (self.graphite_host, metric_string))
>>> bytes('foo', 'ascii')
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: str() takes at most 1 argument (2 given)