diff --git a/changelog.md b/changelog.md index 197a7404..2219fc44 100644 --- a/changelog.md +++ b/changelog.md @@ -23,6 +23,7 @@ Internal * Improve pull request template lint commands. * Complete typehinting the non-test codebase. * Modernization: conversion to f-strings. +* Modernization: remove more Python 2 compatibility logic. 1.37.1 (2025/07/28) diff --git a/mycli/packages/toolkit/history.py b/mycli/packages/toolkit/history.py index 1c90dc0f..35973b98 100644 --- a/mycli/packages/toolkit/history.py +++ b/mycli/packages/toolkit/history.py @@ -36,10 +36,8 @@ def add() -> None: history_with_timestamp.append((string, timestamp)) if os.path.exists(self.filename): - with open(self.filename, "rb") as f: - for line_bytes in f: - line = line_bytes.decode("utf-8", errors="replace") - + with open(self.filename, 'r', encoding='utf-8') as f: + for line in f: if line.startswith("#"): # Extract timestamp timestamp = line[2:].strip()