Skip to content

Commit ccb8cb7

Browse files
committed
A few changes from:
python-diamond#615
1 parent 73207d0 commit ccb8cb7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/diamond/handler/graphite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def _send_data(self, data):
128128
Try to send all data in buffer.
129129
"""
130130
try:
131+
str.encode(data)
131132
self.socket.sendall(data)
132133
self._reset_errors()
133134
except:
@@ -136,6 +137,7 @@ def _send_data(self, data):
136137
"trying reconnect.")
137138
self._connect()
138139
try:
140+
str.encode(data)
139141
self.socket.sendall(data)
140142
except:
141143
return

src/diamond/handler/queue.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
from . Handler import Handler
9-
import Queue
9+
import queue
1010

1111

1212
class QueueHandler(Handler):
@@ -34,7 +34,7 @@ def _process(self, metric):
3434
"""
3535
try:
3636
self.queue.put(metric, block=False)
37-
except Queue.Full:
37+
except queue.Full:
3838
self._throttle_error('Queue full, check handlers for delays')
3939

4040
def flush(self):
@@ -48,5 +48,5 @@ def _flush(self):
4848
# Send a None down the queue to indicate a flush
4949
try:
5050
self.queue.put(None, block=False)
51-
except Queue.Full:
51+
except queue.Full:
5252
self._throttle_error('Queue full, check handlers for delays')

src/diamond/utils/classes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def load_collectors_from_paths(paths):
121121

122122
if isinstance(paths, str):
123123
paths = paths.split(',')
124-
paths = map(str.strip, paths)
125124

126125
load_include_path(paths)
127126

0 commit comments

Comments
 (0)