mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 17:12:40 +00:00
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.
This commit is contained in:
@@ -37,7 +37,6 @@ from perfect (in either direction).
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import codecs
|
|
||||||
import copy
|
import copy
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
@@ -2257,8 +2256,8 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
|
|||||||
if _cpplint_state.stdin_filename is not None:
|
if _cpplint_state.stdin_filename is not None:
|
||||||
filename = _cpplint_state.stdin_filename
|
filename = _cpplint_state.stdin_filename
|
||||||
else:
|
else:
|
||||||
lines = codecs.open(
|
lines = open(
|
||||||
filename, 'r', 'utf8', 'replace').read().split('\n')
|
filename, 'r', encoding='utf-8', errors='replace', newline=None).read().split('\n')
|
||||||
|
|
||||||
# Remove trailing '\r'.
|
# Remove trailing '\r'.
|
||||||
for linenum in range(len(lines)):
|
for linenum in range(len(lines)):
|
||||||
|
|||||||
Reference in New Issue
Block a user