<?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>105380</bug_id>
          
          <creation_ts>2012-12-18 19:36:30 -0800</creation_ts>
          <short_desc>[chromium] webkitpy-test: executive.py stringify_args error on the release test bot</short_desc>
          <delta_ts>2013-01-13 19:18:23 -0800</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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="noel gordon">noel.gordon</reporter>
          <assigned_to name="Dirk Pranke">dpranke</assigned_to>
          <cc>abarth</cc>
    
    <cc>dpranke</cc>
    
    <cc>eric</cc>
    
    <cc>jyasskin</cc>
    
    <cc>ojan</cc>
    
    <cc>rniwa</cc>
    
    <cc>tony</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>794282</commentid>
    <comment_count>0</comment_count>
    <who name="noel gordon">noel.gordon</who>
    <bug_when>2012-12-18 19:36:30 -0800</bug_when>
    <thetext>http://build.webkit.org/builders/Chromium%20Win%20Release%20%28Tests%29/builds/32021/steps/webkitpy-test/logs/stdio

Suppressing most webkitpy logging while running unit tests.
Skipping tests in the following modules or packages because they are really, really, slow:
    webkitpy.common.checkout.scm.scm_unittest
    (https://bugs.webkit.org/show_bug.cgi?id=31818; use --all to include)

Skipping tests in the following modules or packages because they fail horribly on win32:
    webkitpy.common.checkout
    webkitpy.common.config
    webkitpy.tool
    (https://bugs.webkit.org/show_bug.cgi?id=54526; use --all to include)

11Checking autoinstalled packages ...
Checking imports ...
Finding the individual test methods ...
Running the tests ...
[111/1309] webkitpy.common.system.executive_unittest.ExecutiveTest.test_run_command_with_unicode erred:
  Traceback (most recent call last):
    File &quot;E:\google-windows-4\chromium-win-release-tests\build\Tools\Scripts\webkitpy\common\system\executive_unittest.py&quot;, line 148, in test_run_command_with_unicode
      output = executive.run_command(command_line(&apos;echo&apos;, unicode_tor_input))
    File &quot;E:\google-windows-4\chromium-win-release-tests\build\Tools\Scripts\webkitpy\common\system\executive.py&quot;, line 419, in run_command
      close_fds=self._should_close_fds())
    File &quot;E:\google-windows-4\chromium-win-release-tests\build\Tools\Scripts\webkitpy\common\system\executive.py&quot;, line 489, in popen
      string_args = self._stringify_args(args)
    File &quot;E:\google-windows-4\chromium-win-release-tests\build\Tools\Scripts\webkitpy\common\system\executive.py&quot;, line 476, in _stringify_args
      string_args = map(unicode, args)
  UnicodeDecodeError: &apos;ascii&apos; codec can&apos;t decode byte 0xf8 in position 23: ordinal not in range(128)
  
[904/1309] webkitpy.layout_tests.run_webkit_tests_integrationtest.RunTest.test_run_part passed
Ran 1309 tests in 17.675s
FAILED (failures=0, errors=1)
program finished with exit code 1
elapsedTime=19.594000</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>794284</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-18 19:41:41 -0800</bug_when>
    <thetext>I guess I&apos;m not surprised by this.  But it means we need to fix:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/system/executive.py#L469

presumably to have a fallback character when the encoding fails.

This is basically a real bug which we&apos;ve had, but are now finally testing. :)  This is just telling us that unicode-based contributor names (and any other unicode) currently cause webkit-patch to barf on windows.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>795859</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 15:20:54 -0800</bug_when>
    <thetext>I believe we just change that line to .encode(encoding, errors=&quot;replace&quot;) and it should do something sensible.  The unittest will still fail, so we&apos;d have to skip it for windows.  I can&apos;t easily fix this w/o a windows machine.  We can just skip the unittest.  Dirk may have other thoughts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796064</commentid>
    <comment_count>3</comment_count>
      <attachid>180461</attachid>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-12-20 19:37:53 -0800</bug_when>
    <thetext>Created attachment 180461
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796067</commentid>
    <comment_count>4</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-12-20 19:38:58 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I believe we just change that line to .encode(encoding, errors=&quot;replace&quot;) and it should do something sensible.  The unittest will still fail, so we&apos;d have to skip it for windows.  I can&apos;t easily fix this w/o a windows machine.  We can just skip the unittest.  Dirk may have other thoughts.

No, I don&apos;t think we want to do that ... I think it was just a simple bug in your earlier patch where we were dual-encoding things. I&apos;ve posted a fix and verified it works on both win and mac.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796070</commentid>
    <comment_count>5</comment_count>
      <attachid>180461</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 19:45:47 -0800</bug_when>
    <thetext>Comment on attachment 180461
Patch

This will cause the args argument of ScriptError to not be encoded.  But maybe that&apos;s fine.  It&apos;s possible the map(unicode, args) should be separated from the encode(), and I should not have grouped them both in _stringify.  We can map(unicode) all we want, but we can only encode once, and need to do it right before we call out to subprocess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796076</commentid>
    <comment_count>6</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2012-12-20 19:53:04 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (From update of attachment 180461 [details])
&gt; This will cause the args argument of ScriptError to not be encoded.  But maybe that&apos;s fine.  It&apos;s possible the map(unicode, args) should be separated from the encode(), and I should not have grouped them both in _stringify.  We can map(unicode) all we want, but we can only encode once, and need to do it right before we call out to subprocess.

Yeah. I would think either we should leave the args alone in ScriptError (thus capturing what was actually passed to run_command, rather than the encoded version), or stringify in the call to the ScriptError constructor. I&apos;d probably vote for the former.

See, and I told you to leave the stringifying alone :).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796078</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 20:06:35 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (From update of attachment 180461 [details] [details])
&gt; &gt; This will cause the args argument of ScriptError to not be encoded.  But maybe that&apos;s fine.  It&apos;s possible the map(unicode, args) should be separated from the encode(), and I should not have grouped them both in _stringify.  We can map(unicode) all we want, but we can only encode once, and need to do it right before we call out to subprocess.
&gt; 
&gt; Yeah. I would think either we should leave the args alone in ScriptError (thus capturing what was actually passed to run_command, rather than the encoded version), or stringify in the call to the ScriptError constructor. I&apos;d probably vote for the former.
&gt; 
&gt; See, and I told you to leave the stringifying alone :).

Yes. :)  But now we understand what&apos;s going on!

So I think the ideal fix IMO, is to get rid of _stringify_args, and instead manually run map(unicode, args) in the places we need to, and _encode_if_needed in the places we need to.

Your current patch is also fine, and I&apos;ll r+ it.  We can also land yours and I can look at &quot;cleaning this up&quot; more (aka breaking windows harder!) later. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796082</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 20:10:35 -0800</bug_when>
    <thetext>The problem (as I see it), is that I attempted to get too cutesy in code, and ended up conflating two concepts.

1.  The convenience of being able to pass non-string arguments (aka numbers) to run_command, popen, etc. and not have subprocess throw kittens at us.

2.  The necessity of working around sucky windows unicode support by encoding to the local code-page before calling subprocess.

Both of these are really things that I think subprocess should do for us... :)  But I can see why they chose to make it simple/rigid like they did.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796083</commentid>
    <comment_count>9</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 20:11:18 -0800</bug_when>
    <thetext>It&apos;s also really dangerous that I now know how to CC a former maintainer of subprocess on webkit bugs!  Sorry Jeffery.  Well, kinda sorry. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>796092</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-12-20 20:21:53 -0800</bug_when>
    <thetext>Dirk: It would be nice if we could come up with a way to test this on non-windows...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799581</commentid>
    <comment_count>11</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2013-01-03 12:44:47 -0800</bug_when>
    <thetext>*** Bug 105989 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806039</commentid>
    <comment_count>12</comment_count>
      <attachid>180461</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-13 18:21:13 -0800</bug_when>
    <thetext>Comment on attachment 180461
Patch

Red bots make noel sad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806040</commentid>
    <comment_count>13</comment_count>
      <attachid>180461</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-13 18:24:12 -0800</bug_when>
    <thetext>Comment on attachment 180461
Patch

Clearing flags on attachment: 180461

Committed r139579: &lt;http://trac.webkit.org/changeset/139579&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806041</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-13 18:24:16 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806049</commentid>
    <comment_count>15</comment_count>
    <who name="noel gordon">noel.gordon</who>
    <bug_when>2013-01-13 19:18:23 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; (From update of attachment 180461 [details])
&gt; Red bots make noel sad.


Some green over there would be nice for a change:

http://build.webkit.org/builders/Chromium%20Win%20Release%20%28Tests%29?numbuilds=200</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>180461</attachid>
            <date>2012-12-20 19:37:53 -0800</date>
            <delta_ts>2013-01-13 18:24:12 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-105380-20121220193509.patch</filename>
            <type>text/plain</type>
            <size>1661</size>
            <attacher name="Dirk Pranke">dpranke</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM4MzI3CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggNGE5N2NjYWI1ZWVkN2VmOGJmOTZjNWVlODU4ZTM0MDM3
Mjk2MmY0NS4uNTQ0OWRmYTQzNmM4Yjg4NGI1OGQ5MmRlZGQ3ZmI5YzYxNjljNmNjYyAxMDA2NDQK
LS0tIGEvVG9vbHMvQ2hhbmdlTG9nCisrKyBiL1Rvb2xzL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4
IEBACisyMDEyLTEyLTIwICBEaXJrIFByYW5rZSAgPGRwcmFua2VAY2hyb21pdW0ub3JnPgorCisg
ICAgICAgIFtjaHJvbWl1bV0gd2Via2l0cHktdGVzdDogZXhlY3V0aXZlLnB5IHN0cmluZ2lmeV9h
cmdzIGVycm9yIG9uIHRoZSByZWxlYXNlIHRlc3QgYm90CisgICAgICAgIGh0dHBzOi8vYnVncy53
ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMDUzODA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