Commits

ms2ger committed a38ab20

Stop opening files in binary mode.

  • Participants
  • Parent commits ea62532

Comments (0)

Files changed (3)

File anolislib/processes/refs.py

       dl.append(self.createReference(r, informative))
 
   def buildReferences(self, ElementTree, xref="data", **kwargs):
-    list = open(xref + "/references.json", "rb")
+    list = open(xref + "/references.json", "r")
     self.refs = json.load(list)
     list.close()
 

File anolislib/processes/xref.py

 
     def getDfns(self, dump_xrefs, **kwargs):
         try:
-            fp = open(dump_xrefs, u"rb")
+            fp = open(dump_xrefs, "r")
             data = json.load(fp)
             fp.close()
             data["definitions"] = self.dfns
 
     def dump(self, obj, f, **kwargs):
         d = json.dumps(obj, sort_keys=True, allow_nan=False, indent=2, separators=(',', ': '))
-        fp = open(f, u"wb")
+        fp = open(f, "w")
         fp.write(d + u"\n")
         fp.close()
 

File anolislib/processes/xspecxref.py

     self.addReferences(ElementTree, **kwargs)
 
   def buildReferences(self, ElementTree, xref, allow_duplicate_dfns=False, **kwargs):
-    manifest = open(xref + "/specs.json", "rb")
+    manifest = open(xref + "/specs.json", "r")
     specs = json.load(manifest)
     manifest.close()
 
     for (k, v) in specs.iteritems():
-      file = open(xref + "/xrefs/" + v, "rb")
+      file = open(xref + "/xrefs/" + v, "r")
       dfn = json.load(file)
       file.close()
       self.dfns[k] = { "url" : dfn["url"], "values" : dfn["definitions"] }