Skip to content

Commit 05725e3

Browse files
committed
lib: use bytes_to_str() in xlog_rows()
Since Python 3.6+ in json.loads() object that should be deserialized can be of type bytes or bytearray. The input encoding should be UTF-8, UTF-16 or UTF-32 [1]. Patch follows up commit 395edeb ('python3: decouple bytes and strings') and it is a part of task with switching to Python 3. 1. https://docs.python.org/3/library/json.html Follows up: #20
1 parent b21551c commit 05725e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def xlog_rows(xlog_path):
293293
with open(os.devnull, 'w') as devnull:
294294
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=devnull)
295295
for line in process.stdout.readlines():
296-
yield json.loads(line)
296+
yield json.loads(bytes_to_str(line))
297297

298298

299299
def extract_schema_from_snapshot(snapshot_path):

0 commit comments

Comments
 (0)