[webkit-reviews] review granted: [Bug 183605] [WinCairo] Fix incompatibility of run-webkit-httpd on native Windows. : [Attachment 335893] PATCH

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 19 15:11:48 PDT 2018


Daniel Bates <dbates at webkit.org> has granted Basuke Suzuki
<Basuke.Suzuki at sony.com>'s request for review:
Bug 183605: [WinCairo] Fix incompatibility of run-webkit-httpd on native
Windows.
https://bugs.webkit.org/show_bug.cgi?id=183605

Attachment 335893: PATCH

https://bugs.webkit.org/attachment.cgi?id=335893&action=review




--- Comment #15 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 335893
  --> https://bugs.webkit.org/attachment.cgi?id=335893
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=335893&action=review

OK.

> Tools/Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py:126
> +def temp_log_file(platform):
> +    """Workaround for Windows.
> +    From the document:
https://docs.python.org/2/library/tempfile.html#module-tempfile
> +    | Whether the name can be used to open the file a second time, while the
named temporary
> +    | file is still open, varies across platforms (it can be so used on
Unix; it cannot on
> +    | Windows NT or later).
> +    """
> +    temp_file = tempfile.NamedTemporaryFile()
> +    if platform.is_win():
> +	   temp_file.close()
> +    yield temp_file.name
> +

I take it the issue is that Windows only allows one process to have write
access to file? Without your patch, Python has write access to the temp file
and Apache wants to have write access to the same file. With your patch, Python
only has read access to the temp file (since the Python builtin open() opens
the specified file for read access when the mode argument is omitted) and hence
Apache can acquire write access to the temp file.


More information about the webkit-reviews mailing list