<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>229866</bug_id>
          
          <creation_ts>2021-09-03 07:20:13 -0700</creation_ts>
          <short_desc>apply-watchlist fails for patches with non-unicode characters</short_desc>
          <delta_ts>2021-09-10 09:14:30 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=223525</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aakash Jain">aakash_jain</reporter>
          <assigned_to name="Jonathan Bedard">jbedard</assigned_to>
          <cc>aakash_jain</cc>
    
    <cc>ap</cc>
    
    <cc>jbedard</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1790148</commentid>
    <comment_count>0</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2021-09-03 07:20:13 -0700</bug_when>
    <thetext>apply-watchlist fails for patches with non-unicode characters, both with python2 and python3. e.g.:

e.g.:
https://ews-build.webkit-uat.org/#/builders/2/builds/115 (python 2)
https://ews-build.webkit-uat.org/#/builders/2/builds/114 (python 3)

Traceback (most recent call last):
  File &quot;Tools/Scripts/webkit-patch&quot;, line 80, in &lt;module&gt;
    main()
  File &quot;Tools/Scripts/webkit-patch&quot;, line 75, in main
    WebKitPatch(os.path.abspath(__file__)).main()
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/multicommandtool.py&quot;, line 305, in main
    result = command.check_arguments_and_execute(options, args, self)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/multicommandtool.py&quot;, line 123, in check_arguments_and_execute
    return self.execute(options, args, tool) or 0
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py&quot;, line 55, in execute
    self._sequence.run_and_handle_errors(tool, options, state)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/commands/stepsequence.py&quot;, line 73, in run_and_handle_errors
    self._run(tool, options, state)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/commands/stepsequence.py&quot;, line 67, in _run
    step(tool, options).run(state)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/tool/steps/applywatchlist.py&quot;, line 48, in run
    cc_and_messages = self._tool.watch_list().determine_cc_and_messages(diff)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/common/watchlist/watchlist.py&quot;, line 71, in determine_cc_and_messages
    definitions = self.find_matching_definitions(diff)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/common/watchlist/watchlist.py&quot;, line 40, in find_matching_definitions
    patch_files = DiffParser(diff.splitlines()).files
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/common/checkout/diff_parser.py&quot;, line 148, in __init__
    self.files = self._parse_into_diff_files(diff_input)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/webkitpy/common/checkout/diff_parser.py&quot;, line 159, in _parse_into_diff_files
    line = string_utils.decode(line).rstrip(&quot;\n&quot;)
  File &quot;/Volumes/Data/worker/Apply-WatchList-EWS/build/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/string_utils.py&quot;, line 46, in decode
    return data.decode(encoding, errors=errors)
UnicodeDecodeError: &apos;utf-8&apos; codec can&apos;t decode byte 0xcf in position 18: invalid continuation byte</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1790161</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2021-09-03 07:49:41 -0700</bug_when>
    <thetext>Seems like we might need to parse this as bytes, then, which is what I was trying to avoid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1792369</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-10 09:14:30 -0700</bug_when>
    <thetext>&lt;rdar://problem/82975130&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>