<?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>53822</bug_id>
          
          <creation_ts>2011-02-04 15:56:59 -0800</creation_ts>
          <short_desc>test-webkitpy crashes with a WindowsError when run under Win32 Python</short_desc>
          <delta_ts>2024-09-23 19:15:15 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>53854</dependson>
          <blocked>48728</blocked>
    
    <blocked>55811</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Tony Chang">tony</reporter>
          <assigned_to name="Tony Chang">tony</assigned_to>
          <cc>abarth</cc>
    
    <cc>aroben</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
    
    <cc>evan</cc>
    
    <cc>fujii</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>345877</commentid>
    <comment_count>0</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-04 15:56:59 -0800</bug_when>
    <thetext>get test-webkitpy running on win32 python</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345878</commentid>
    <comment_count>1</comment_count>
      <attachid>81312</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-04 15:59:05 -0800</bug_when>
    <thetext>Created attachment 81312
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345879</commentid>
    <comment_count>2</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-04 15:59:34 -0800</bug_when>
    <thetext>For reference, here&apos;s the current bot output:
http://build.webkit.org/builders/Chromium%20Win%20Release%20%28Tests%29/builds/8789/steps/webkitpy-test/logs/stdio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345881</commentid>
    <comment_count>3</comment_count>
      <attachid>81312</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-04 16:12:30 -0800</bug_when>
    <thetext>Comment on attachment 81312
Patch

I guess.  Shell is *evil*.  I suspect this will cause other troubles.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345883</commentid>
    <comment_count>4</comment_count>
      <attachid>81312</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-04 16:13:31 -0800</bug_when>
    <thetext>Comment on attachment 81312
Patch

Should we do our own path resolution instead?  I feel like at some other point I needed/wanted a &quot;which&quot; command written in python.  I guess if we don&apos;t use a shell, we won&apos;t get the environment in which PATH is defined anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345898</commentid>
    <comment_count>5</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2011-02-04 16:27:03 -0800</bug_when>
    <thetext>FWIW, I would guess eseidel&apos;s dislike of going through a shell because of quoting issues, but on on Windows the low-level process creation API takes a string so you need to get quoting right anyway (http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx).  Python implicitly converts the array of args to a quoted command line for you on Windows.  Passing shell=True on Windows is pretty standard in Python code I see, though I admit it&apos;s all within a small circle of people.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345904</commentid>
    <comment_count>6</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-04 16:30:25 -0800</bug_when>
    <thetext>Mid-air conflict while I was writing pretty much what Evan wrote.

The only thing I have to add is that since we expect subprocess.Popen to include the environment on other platforms, it seems to be semantically consistent to for us to use shell=True on Windows.  Although in practice, maybe we don&apos;t need the environment to be copied to subprocesses.

*shrug*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345914</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-04 16:35:14 -0800</bug_when>
    <thetext>We&apos;ve talked about creating our own POpen subclass to fix some of the popen bugs we work-around in Executive.   This might be further (mild) motivation for such.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345937</commentid>
    <comment_count>8</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-04 17:22:14 -0800</bug_when>
    <thetext>I don&apos;t remember running into this problem back when I was working on getting test-webkitpy working with Win32 Python. But test-webkitpy has undoubtedly changed since then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345938</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-02-04 17:23:49 -0800</bug_when>
    <thetext>The subprocess docs say this:

The only reason you would need to specify shell=True on Windows is where the command you wish to execute is actually built in to the shell, eg dir, copy. You don’t need shell=True to run a batch file, nor to run a console-based executable.

http://docs.python.org/library/subprocess.html#using-the-subprocess-module

So…are the docs wrong? Is there some other reason you&apos;d have to pass shell=True on Windows?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345992</commentid>
    <comment_count>10</comment_count>
      <attachid>81312</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 18:39:14 -0800</bug_when>
    <thetext>Comment on attachment 81312
Patch

Clearing flags on attachment: 81312

Committed r77720: &lt;http://trac.webkit.org/changeset/77720&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345993</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 18:39:20 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346010</commentid>
    <comment_count>12</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-04 19:18:37 -0800</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 81312:

http/tests/websocket/tests/send-throw.html bug 53834 (author: abarth@webkit.org)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346021</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-02-04 19:43:24 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/77720 might have broken GTK Linux 64-bit Debug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346618</commentid>
    <comment_count>14</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-07 09:22:11 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; The subprocess docs say this:
&gt; 
&gt; The only reason you would need to specify shell=True on Windows is where the command you wish to execute is actually built in to the shell, eg dir, copy. You don’t need shell=True to run a batch file, nor to run a console-based executable.
&gt; 
&gt; http://docs.python.org/library/subprocess.html#using-the-subprocess-module
&gt; 
&gt; So…are the docs wrong? Is there some other reason you&apos;d have to pass shell=True on Windows?

The docs are correct, it just doesn&apos;t enumerate all the reasons to use the shell on Windows.  We needed it to search the path for things like &apos;svn&apos; or &apos;ruby&apos;.  Here&apos;s the python bug tracking the difference:
  http://bugs.python.org/issue8557

Anyway, this was rolled out because when shell=True and the command isn&apos;t found, we raise ScriptError rather then OSError.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346725</commentid>
    <comment_count>15</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-07 12:44:10 -0800</bug_when>
    <thetext>ScriptError was originally creaed as part of scm.py to indicate when git/svn returned non-zero.

These days it&apos;s used for more than that I fear.

But still we should return OSError when  we can&apos;t find a command instead of ScriptError.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346781</commentid>
    <comment_count>16</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-02-07 14:10:26 -0800</bug_when>
    <thetext>(In reply to comment #15)

&gt; But still we should return OSError when  we can&apos;t find a command instead of ScriptError.

Hmm, I&apos;m not sure how to do this.  The return code is 1, but that doesn&apos;t always mean that the command wasn&apos;t found.  I could search the command output to see if the command wasn&apos;t found, but I suspect for non-English versions of Windows, the text will differ.

Eric&apos;s original suggestion of writing our own path resolution is possible (it&apos;s a cross product of PATH and PATHEXT), but I worry that we&apos;ll get it wrong.  E.g., is it possible for other environment variables to be in %PATH%?  What are the rules for case insensitivity?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2062598</commentid>
    <comment_count>17</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2024-09-23 19:14:23 -0700</bug_when>
    <thetext>no problem with Windows Python nowadays.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2062599</commentid>
    <comment_count>18</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-09-23 19:15:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/136549155&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81312</attachid>
            <date>2011-02-04 15:59:05 -0800</date>
            <delta_ts>2011-02-04 18:39:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-53822-20110204160033.patch</filename>
            <type>text/plain</type>
            <size>2824</size>
            <attacher name="Tony Chang">tony</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1Rvb2xzL0NoYW5nZUxvZyBiL1Rvb2xzL0NoYW5nZUxvZwppbmRleCA0MWJi
Y2JjMzc5N2Y5ZGFlMGZlMmZmMjk0YjFmMDcxNjE2ZDFiYWUxLi5jODEzYWZkZGZkNzc4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MjMsOCBAQCBjbGFzcyBFeGVjdXRpdmUob2JqZWN0KToKICAgICAgICAgY2hpbGRfcHJvY2Vz
cyA9IHN1YnByb2Nlc3MuUG9wZW4oYXJncywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgc3Rkb3V0PXN1YnByb2Nlc3MuUElQRSwKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgc3RkZXJyPXN1YnByb2Nlc3MuU1RET1VULAotICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZV9mZHM9c2VsZi5fc2hvdWxkX2Ns
b3NlX2ZkcygpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9z
ZV9mZHM9c2VsZi5fc2hvdWxkX2Nsb3NlX2ZkcygpLAorICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBzaGVsbD1zZWxmLl9zaG91bGRfdXNlX3NoZWxsKCkpCiAKICAgICAg
ICAgIyBVc2Ugb3VyIG93biBjdXN0b20gd2FpdCBsb29wIGJlY2F1c2UgUG9wZW4gaWdub3JlcyBh
IHRlZSdkCiAgICAgICAgICMgc3RkZXJyL3N0ZG91dC4KQEAgLTM1MSw3ICszNTcsOCBAQCBjbGFz
cyBFeGVjdXRpdmUob2JqZWN0KToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
c3Rkb3V0PXN1YnByb2Nlc3MuUElQRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgc3RkZXJyPXN0ZGVyciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3dk
PWN3ZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VfZmRzPXNlbGYu
X3Nob3VsZF9jbG9zZV9mZHMoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
Y2xvc2VfZmRzPXNlbGYuX3Nob3VsZF9jbG9zZV9mZHMoKSwKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgc2hlbGw9c2VsZi5fc2hvdWxkX3VzZV9zaGVsbCgpKQogICAgICAgICBv
dXRwdXQgPSBwcm9jZXNzLmNvbW11bmljYXRlKHN0cmluZ190b19jb21tdW5pY2F0ZSlbMF0KIAog
ICAgICAgICAjIHJ1bl9jb21tYW5kIGF1dG9tYXRpY2FsbHkgZGVjb2RlcyB0byB1bmljb2RlKCkg
dW5sZXNzIGV4cGxpY2l0bHkgdG9sZCBub3QgdG8uCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>