From 6e9e74c8c6133675c21fc061302ed240aac53484 Mon Sep 17 00:00:00 2001 From: Panagiotis Georgakopoulos Date: Sat, 8 Apr 2023 19:05:10 +0300 Subject: [PATCH] fix: don't crash on 'utf-8' messages --- kombu/transport/virtual/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kombu/transport/virtual/base.py b/kombu/transport/virtual/base.py index d8441f80..4c3ede51 100644 --- a/kombu/transport/virtual/base.py +++ b/kombu/transport/virtual/base.py @@ -802,12 +802,12 @@ class Channel(AbstractChannel, base.StdChannel): self.exchange_types = None def encode_body(self, body, encoding=None): - if encoding: + if encoding and encoding.lower() != 'utf-8': return self.codecs.get(encoding).encode(body), encoding return body, encoding def decode_body(self, body, encoding=None): - if encoding: + if encoding and encoding.lower() != 'utf-8': return self.codecs.get(encoding).decode(body) return body