Skip to content

Commit

Permalink
DevOps: Address deprecation warnings (#1211)
Browse files Browse the repository at this point in the history
* `pipes` module of standard library is replaced with `shlex`
 * `pyzmq.utils.strtypes` was compatibility layer for Python 2 and 3.
   The `u` method was to convert to unicode but this is no longer
   applicable in Python 3 so can be removed.
 * Address internal deprecation warnings of `statsd` not being set to
   `True` in the config if a stats endpoint is defined.
  • Loading branch information
sphuber committed Nov 20, 2022
1 parent 328d528 commit a414f9a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions circus/tests/config/reload_statsd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ check_delay = -1
endpoint = tcp://127.0.0.1:7555
pubsub_endpoint = tcp://127.0.0.1:7556
stats_endpoint = tcp://127.0.0.1:5557
statsd = True

[watcher:test1]
cmd = sleep 120
Expand Down
1 change: 1 addition & 0 deletions circus/tests/config/reuseport.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
stats_endpoint = tcp://127.0.0.1:5557
statsd = True

[socket:reuseport]
host = 127.0.0.1
Expand Down
3 changes: 1 addition & 2 deletions circus/tests/test_stdin_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from circus.tests.support import skipIf, IS_WINDOWS
from circus.stream import QueueStream, Empty
from circus.util import tornado_sleep
from zmq.utils.strtypes import u
from circus.sockets import CircusSocket


Expand All @@ -25,7 +24,7 @@ def read_from_stream(stream, timeout=5):
while time.time() - start < timeout:
try:
data = stream.get_nowait()
raise tornado.gen.Return(u(data['data']))
raise tornado.gen.Return(data['data'].decode('utf-8'))
except Empty:
yield tornado_sleep(.1)
raise TimeoutException('Timeout reading queue')
Expand Down
3 changes: 1 addition & 2 deletions circus/tests/test_umask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from circus.tests.support import skipIf, IS_WINDOWS
from circus.stream import QueueStream, Empty
from circus.util import tornado_sleep
from zmq.utils.strtypes import u


class Process(object):
Expand Down Expand Up @@ -53,7 +52,7 @@ def read_from_stream(stream, timeout=5):
while time.time() - start < timeout:
try:
data = stream.get_nowait()
raise tornado.gen.Return(u(data['data']))
raise tornado.gen.Return(data['data'].decode('utf-8'))
except Empty:
yield tornado_sleep(0.1)
raise TimeoutException('Timeout reading queue')
Expand Down
2 changes: 1 addition & 1 deletion circus/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from datetime import timedelta
from functools import wraps
import signal
from pipes import quote as shell_escape_arg
from shlex import quote as shell_escape_arg

try:
import importlib
Expand Down

0 comments on commit a414f9a

Please sign in to comment.