From 57119c1b300d8f7b1cc87c6aea9b1bf5a294d87f Mon Sep 17 00:00:00 2001 From: Louis Del Valle <92354925+nero-dv@users.noreply.github.com> Date: Sun, 23 Jun 2024 23:56:51 -0500 Subject: [PATCH] Update block_requests.py to resolve unexpected type error (500 error) (#5976) --- modules/block_requests.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/block_requests.py b/modules/block_requests.py index 0eb10fa2..e95cd7e2 100644 --- a/modules/block_requests.py +++ b/modules/block_requests.py @@ -43,19 +43,19 @@ def my_open(*args, **kwargs): with original_open(*args, **kwargs) as f: file_contents = f.read() - file_contents = file_contents.replace(b'\t\t', b'') - file_contents = file_contents.replace(b'cdnjs.cloudflare.com', b'127.0.0.1') + file_contents = file_contents.replace('\t\t', '') + file_contents = file_contents.replace('cdnjs.cloudflare.com', b'127.0.0.1') file_contents = file_contents.replace( - b'', - b'\n ' - b'\n ' - b'\n ' - b'\n ' - b'\n ' - b'\n ' + '', + '\n ' + '\n ' + '\n ' + '\n ' + '\n ' + '\n ' ) - return io.BytesIO(file_contents) + return io.StringIO(file_contents) else: return original_open(*args, **kwargs)