Skip to content

Commit

Permalink
Use six.ensure_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed May 14, 2024
1 parent 872e63e commit ced80a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions warcio/capture_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from io import BytesIO

from six import ensure_binary
from six.moves import http_client as httplib

from contextlib import contextmanager
Expand Down Expand Up @@ -165,11 +166,11 @@ def set_remote_ip(self, remote_ip):

def write_request(self, buff):
if self.started_req:
self.request_out.write(buff.encode())
self.request_out.write(ensure_binary(buff))

def write_response(self, buff):
if self.started_req:
self.response_out.write(buff.encode())
self.response_out.write(ensure_binary(buff))

def _create_record(self, out, record_type):
length = out.tell()
Expand Down

0 comments on commit ced80a5

Please sign in to comment.