Changeset 58016 in webkit
- Timestamp:
- Apr 21, 2010 3:51:44 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r58014 r58016 1 2010-04-21 Eric Seidel <eric@webkit.org> 2 3 Unreviewed, just fixing exception seen on builders. 4 5 REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø 6 https://bugs.webkit.org/show_bug.cgi?id=37765 7 8 * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: 9 - Pass and encoding to _write_into_file_at_path 10 1 11 2010-04-21 Eric Seidel <eric@webkit.org> 2 12 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
r58014 r58016 154 154 raise NotImplemented 155 155 156 def _write_into_file_at_path(self, file_path, byte_array): 157 """This method assumes that byte_array is already encoded 158 into the right format.""" 159 with open(file_path, "wb") as file: 160 file.write(byte_array) 156 def _write_into_file_at_path(self, file_path, contents, encoding=None): 157 """Writes contents at file_path, using encoding.""" 158 with codecs.open(file_path, "w", encoding) as file: 159 file.write(contents) 161 160 162 161 def write_output_files(self, port, filename, file_type, … … 180 179 actual_filename = self.output_filename(filename, self.FILENAME_SUFFIX_ACTUAL + file_type) 181 180 expected_filename = self.output_filename(filename, self.FILENAME_SUFFIX_EXPECTED + file_type) 181 # FIXME: The fact that this function can take many different 182 # types of data is a total hack. 183 encoding = "utf-8" if print_text_diffs else None 182 184 if output: 183 self._write_into_file_at_path(actual_filename, output )185 self._write_into_file_at_path(actual_filename, output, encoding) 184 186 if expected: 185 self._write_into_file_at_path(expected_filename, expected )187 self._write_into_file_at_path(expected_filename, expected, encoding) 186 188 187 189 if not output or not expected: … … 193 195 diff = port.diff_text(expected, output, expected_filename, actual_filename) 194 196 diff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_DIFF + file_type) 195 self._write_into_file_at_path(diff_filename, diff .encode("utf-8"))197 self._write_into_file_at_path(diff_filename, diff, encoding="utf-8") 196 198 197 199 # Shell out to wdiff to get colored inline diffs. 198 200 wdiff = port.wdiff_text(expected_filename, actual_filename) 199 201 wdiff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_WDIFF) 200 self._write_into_file_at_path(wdiff_filename, wdiff .encode("utf-8"))202 self._write_into_file_at_path(wdiff_filename, wdiff, encoding="utf-8") 201 203 202 204 # Use WebKit's PrettyPatch.rb to get an HTML diff. 203 205 pretty_patch = port.pretty_patch_text(diff_filename) 204 206 pretty_patch_filename = self.output_filename(filename, self.FILENAME_SUFFIX_PRETTY_PATCH) 205 self._write_into_file_at_path(pretty_patch_filename, pretty_patch .encode("utf-8"))207 self._write_into_file_at_path(pretty_patch_filename, pretty_patch, encoding="utf-8")
Note: See TracChangeset
for help on using the changeset viewer.