Simplify things here and use io.open
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 16 Sep 2014 19:37:52 +0000 (14:37 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 16 Sep 2014 19:37:52 +0000 (14:37 -0500)
mediagoblin/tools/metadata.py

index bfefcac9f5ee9694d1e0348055743c2f3ab6dae6..aeb4f8292e87de68848335abe2073da23ce46bfc 100644 (file)
@@ -15,6 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
+from io import open
 import os
 import copy
 import json
@@ -102,7 +103,7 @@ def load_resource(package, resource_path):
       os.path.sep.
     """
     filename = resource_filename(package, os.path.sep.join(resource_path))
-    return file(filename).read()
+    return open(filename, encoding="utf-8").read()
 
 def load_resource_json(package, resource_path):
     """