1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Replace codecs.open() with open() since codecs.open() deprecated in Python 3.14

This commit is contained in:
Alexander Smorkalov
2026-05-24 16:54:39 +03:00
parent 00d19e1c63
commit 852c3d2fb9
4 changed files with 11 additions and 13 deletions
+2 -3
View File
@@ -4,7 +4,6 @@ from __future__ import print_function, unicode_literals
import sys, re, os.path, errno, fnmatch
import json
import logging
import codecs
import io
from shutil import copyfile
from pprint import pformat
@@ -902,7 +901,7 @@ class ObjectiveCWrapperGenerator(object):
content = f.read()
if content == buf:
return
with codecs.open(path, "w", "utf-8") as f:
with open(path, "w", encoding="utf-8") as f:
f.write(buf)
updated_files += 1
@@ -1530,7 +1529,7 @@ typedef NS_ENUM(int, {1}) {{
body = file.read()
body = body.replace("import OpenCV", "import " + framework_name)
body = body.replace("#import <OpenCV/OpenCV.h>", "#import <" + framework_name + "/" + framework_name + ".h>")
with codecs.open(filepath, "w", "utf-8") as file:
with open(filepath, "w", encoding="utf-8") as file:
file.write(body)