Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: chrome/browser/resources/safe_browsing/gen_file_type_proto.py

Issue 1909653002: FileTypePolicies class to load types from proto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up comments, add more tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/safe_browsing/gen_file_type_proto.py
diff --git a/chrome/browser/resources/safe_browsing/gen_file_type_proto.py b/chrome/browser/resources/safe_browsing/gen_file_type_proto.py
index 3c4b5081053de011cba2a28d4998ee0e6418a98b..1698de86d35aefcfb89644edddce2274e5f10871 100755
--- a/chrome/browser/resources/safe_browsing/gen_file_type_proto.py
+++ b/chrome/browser/resources/safe_browsing/gen_file_type_proto.py
@@ -22,7 +22,7 @@ def ConvertProto(opts):
import google.protobuf.text_format as text_format
# Read the ASCII
- ifile = open(opts.infile, 'r')
+ ifile = open(opts.infile, 'rb')
Jialiu Lin 2016/04/22 21:36:41 should it be 'r', since you're not reading a binar
Nathan Parker 2016/04/25 22:39:19 Done.
ascii_pb_str = ifile.read()
ifile.close()
@@ -34,7 +34,7 @@ def ConvertProto(opts):
binary_pb_str = pb.SerializeToString()
# Write it to disk
- open(opts.outfile, 'w').write(binary_pb_str)
+ open(opts.outfile, 'wb').write(binary_pb_str)
def main():

Powered by Google App Engine
This is Rietveld 408576698