<?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>226702</bug_id>
          
          <creation_ts>2021-06-06 17:15:52 -0700</creation_ts>
          <short_desc>run-webkit-tests reports &quot;OSError: [WinError 6] The handle is invalid&quot; with Windows Python3</short_desc>
          <delta_ts>2021-06-07 17:53:57 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>226710</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=226710</see_also>
          <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="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>don.olmstead</cc>
    
    <cc>jbedard</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1767261</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-06-06 17:15:52 -0700</bug_when>
    <thetext>run-webkit-tests reports &quot;OSError: [WinError 6] The handle is invalid&quot; with Windows Python3

Since r278454 (Bug 226234)

PS C:\home\webkit\gc&gt; python3.exe ./Tools/Scripts/run-webkit-tests --wincairo --debug
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = &quot;en_US.UTF-8&quot;,
        LC_MESSAGES = &quot;en_US.UTF-8&quot;,
        LANG = &quot;en_US.UTF-8&quot;
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
Using port &apos;wincairo-win10-wk2&apos;
Test configuration: &lt;win10, x86_64, debug&gt;
Placing test results in C:\home\webkit\gc\WebKitBuild\Debug\bin64\layout-test-results
Using Debug build
Pixel tests disabled
Regular timeout: 30000, slow test timeout: 150000
Command line: C:\home\webkit\gc\WebKitBuild\Debug\bin64\WebKitTestRunner.exe -

Found 71450 tests; running 17972, skipping 53478.

Verbose baseline search path: platform\wincairo-win10-wk2 -&gt; platform\wincairo-win10 -&gt; platform\wincairo-wk2 -&gt; platform\wincairo -&gt; platform\wk2 -&gt; generic

Baseline search path: platform\wincairo -&gt; platform\wk2 -&gt; generic

Running 17972 tests

The _NT_SYMBOL_PATH environment variable is not set. Using Microsoft Symbol Server.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = &quot;en_US.UTF-8&quot;,
        LC_MESSAGES = &quot;en_US.UTF-8&quot;,
        LANG = &quot;en_US.UTF-8&quot;
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
Running 16 WebKitTestRunners in parallel.

Starting 16 workers ...
TypeError raised: cannot pickle &apos;_io.BufferedWriter&apos; object
Traceback (most recent call last):
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 92, in main
    run_details = run(port, options, args, stderr)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 487, in run
    run_details = manager.run(args)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, line 408, in run
    temp_initial_results, temp_retry_results, temp_enabled_pixel_tests_in_retry = self._run_test_subset(test_inputs, device_type=device_type)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, line 482, in _run_test_subset
    initial_results = self._run_tests(test_inputs, self._options.repeat_each, self._options.iterations, int(self._options.child_processes), retrying=False, device_type=device_type)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, line 561, in _run_tests
    return self._runner.run_tests(self._expectations[device_type], new_test_inputs, num_workers, retrying, device_type)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\layout_test_runner.py&quot;, line 165, in run_tests
    with TaskPool(
  File &quot;C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py&quot;, line 388, in __enter__
    worker.start()
  File &quot;C:\Python39\lib\multiprocessing\process.py&quot;, line 121, in start
    self._popen = self._Popen(self)
  File &quot;C:\Python39\lib\multiprocessing\context.py&quot;, line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File &quot;C:\Python39\lib\multiprocessing\context.py&quot;, line 327, in _Popen
    return Popen(process_obj)
  File &quot;C:\Python39\lib\multiprocessing\popen_spawn_win32.py&quot;, line 93, in __init__
    reduction.dump(process_obj, to_child)
  File &quot;C:\Python39\lib\multiprocessing\reduction.py&quot;, line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle &apos;_io.BufferedWriter&apos; object
Stopping Web Platform Test server ...Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Python39\lib\multiprocessing\spawn.py&quot;, line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File &quot;C:\Python39\lib\multiprocessing\reduction.py&quot;, line 79, in duplicate
    return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid
PS C:\home\webkit\gc&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767458</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2021-06-07 08:44:03 -0700</bug_when>
    <thetext>We just need to figure out what object (most likely belonging to the port) is not pickleable, I posted a small function in https://bugs.webkit.org/show_bug.cgi?id=226710 that should be applicable here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767617</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-06-07 17:53:57 -0700</bug_when>
    <thetext>Bug 226710&apos;s WIP patch (attachment#430795) solves this issue.

*** This bug has been marked as a duplicate of bug 226710 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>