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
from __future__ import print_function
from __future__ import unicode_literals
-import codecs, os, sys
+import io, os, sys
import metrics
import util
#######################################################
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.