-def read_patch(filename):
- return file(os.path.join(_test_patch_dir, filename)).read()
+def read_patch(filename, encoding = None):
+ file_path = os.path.join(_test_patch_dir, filename)
+ if encoding is not None:
+ f = codecs.open(file_path, encoding = encoding)
+ else:
+ f = file(file_path)
+
+ return f.read()