summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-20 10:44:36 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-20 10:44:36 -0500
commit7b4250286962da0f8dc6731d7f1c8cec9ccb4146 (patch)
tree8fa9a4cdea4a873b8a3c9707b6f587dbe21ca15e /scripts
parentf733b8acd67f487a56e56bfb454ff99bc8d1cab0 (diff)
parent57ff8d4a5323356a8d879caf8226c934f2e82260 (diff)
downloadtor-7b4250286962da0f8dc6731d7f1c8cec9ccb4146.tar.gz
tor-7b4250286962da0f8dc6731d7f1c8cec9ccb4146.zip
Merge remote-tracking branch 'tor-github/pr/1757/head' into maint-0.4.3
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/practracker/practracker.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index 6149fb79cb..79b13cb056 100755
--- 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 os, sys
+import codecs, os, sys
import metrics
import util
@@ -63,12 +63,8 @@ TOR_TOPDIR = None
#######################################################
-if sys.version_info[0] <= 2:
- def open_file(fname):
- return open(fname, 'r')
-else:
- def open_file(fname):
- return open(fname, 'r', encoding='utf-8')
+def open_file(fname):
+ return codecs.open(fname, 'r', encoding='utf-8')
def consider_file_size(fname, f):
"""Consider the size of 'f' and yield an FileSizeItem for it.