Update har_capture_reader.py

Added UTF-8 encoding to HAR capture reader
pull/7/head
Brad Russell 3 years ago
parent 9bcc575de2
commit 602a6c492c

@ -71,9 +71,9 @@ class HarCaptureReader:
self.progress_callback = progress_callback
def captured_requests(self) -> Iterator[HarFlowWrapper]:
har_file_size = os.path.getsize(self.file_path)
with open(self.file_path, 'r') as f:
with open(self.file_path, 'r', encoding='utf-8') as f:
data = json_stream.load(f)
for entry in data['log']['entries'].persistent():
for entry in data['log']['entries'].persistent():
if self.progress_callback:
self.progress_callback(f.tell() / har_file_size)
yield HarFlowWrapper(entry)

Loading…
Cancel
Save