commit 2483d5ad8af7b87b453bbade51b8f49f5525f143
parent 4b8980949cd47f8206b2fbc266dfeb0920fd1191
Author: Vendetta <vaibhavst004@gmail.com>
Date: Tue, 18 Nov 2025 23:05:42 +0530
fix(clint.py): replace deprecated codecs.open #36593
Remove codecs import and use open(..., encoding='utf-8', errors='replace', newline=None) in clint.py to avoid Python 3.14 DeprecationWarning; preserve existing CR handling.
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/clint.py b/src/clint.py
@@ -37,7 +37,6 @@ from perfect (in either direction).
"""
-import codecs
import copy
import getopt
import os
@@ -2257,8 +2256,8 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
if _cpplint_state.stdin_filename is not None:
filename = _cpplint_state.stdin_filename
else:
- lines = codecs.open(
- filename, 'r', 'utf8', 'replace').read().split('\n')
+ lines = open(
+ filename, 'r', encoding='utf-8', errors='replace', newline=None).read().split('\n')
# Remove trailing '\r'.
for linenum in range(len(lines)):