commit 1982ef09417304e29962b3147e703c6b9947f60c
parent 55ebd06f4658540c554f709b3665486b39222792
Author: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Date: Mon, 15 Sep 2025 19:37:00 -0400
practracker: codecs.open -> io.open for python 3.14
codecs.open is now deprecated: https://docs.python.org/3.14/whatsnew/3.14.html.
it prints a DeprecationWarning which makes tests fail, and may be removed in
the future. io.open works on python 2 and 3
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
@@ -24,7 +24,7 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
-import codecs, os, sys
+import io, os, sys
import metrics
import util
@@ -64,7 +64,7 @@ TOR_TOPDIR = None
#######################################################
def open_file(fname):
- return codecs.open(fname, 'r', encoding='utf-8')
+ return io.open(fname, 'r', encoding='utf-8')
def consider_file_size(fname, f):
"""Consider the size of 'f' and yield an FileSizeItem for it.