Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wpt-lint] Handle FileNotFoundError when git is not found #39416

Conversation

jonathan-j-lee
Copy link
Contributor

tools.lint.lint is unimportable when git does not exist in the PATH:

  ...
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\__init__.py", line 1, in <module>
    from . import lint  # noqa: F401
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\lint.py", line 1135, in <module>
    subprocess.check_output(["git", "--version"])
  ...
  File "C:\b\s\w\ir\.task_template_vpython_cache\vpython\store\cpython-e6tenrlsesftvg6k08ajgkk7b4\contents\bin\Lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

`tools.lint.lint` is unimportable when `git` does not exist in the
`PATH`:

```
  File "C:\b\s\w\ir\third_party\blink\tools\blinkpy\tool\commands\lint_wpt.py", line 16, in <module>
    from tools.lint import lint as wptlint
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\__init__.py", line 1, in <module>
    from . import lint  # noqa: F401
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\lint.py", line 1135, in <module>
    subprocess.check_output(["git", "--version"])
  ...
  File "C:\b\s\w\ir\.task_template_vpython_cache\vpython\store\cpython-e6tenrlsesftvg6k08ajgkk7b4\contents\bin\Lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
```
@jonathan-j-lee jonathan-j-lee marked this pull request as ready for review April 6, 2023 19:47
@jonathan-j-lee jonathan-j-lee requested review from WeizhongX and removed request for jgraham, foolip and DanielRyanSmith April 6, 2023 19:47
@jonathan-j-lee jonathan-j-lee merged commit ad20c1e into web-platform-tests:master Apr 6, 2023
@jonathan-j-lee jonathan-j-lee deleted the lint/fix-without-git branch April 6, 2023 19:50
cookiecrook pushed a commit to cookiecrook/wpt that referenced this pull request Apr 8, 2023
…atform-tests#39416)

`tools.lint.lint` is unimportable when `git` does not exist in the
`PATH`:

```
  File "C:\b\s\w\ir\third_party\blink\tools\blinkpy\tool\commands\lint_wpt.py", line 16, in <module>
    from tools.lint import lint as wptlint
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\__init__.py", line 1, in <module>
    from . import lint  # noqa: F401
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\lint\lint.py", line 1135, in <module>
    subprocess.check_output(["git", "--version"])
  ...
  File "C:\b\s\w\ir\.task_template_vpython_cache\vpython\store\cpython-e6tenrlsesftvg6k08ajgkk7b4\contents\bin\Lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants