New issue
Advanced search Search tips

Issue 840011 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

tools/translation/upload_screenshots.py doesn't work on Windows

Project Member Reported by zmin@chromium.org, May 4 2018

Issue description

Got Exception:

Traceback (most recent call last):
  File "upload_screenshots_unittest.py", line 21, in test_find_screenshots
    os.path.join(testdata_path, 'translation_expectations.pyl'))
  File "D:\src\win\src\tools\translation\upload_screenshots.py", line 102, in find_screenshots
    repo_root, list_grds_in_repository(repo_root), translation_expectations)
  File "D:\src\win\src\tools\translation\upload_screenshots.py", line 83, in list_grds_in_repository
    ['git', 'ls-files', '--', '*.grd'], cwd=repo_path)
  File "D:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "D:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 709, in __init__
    errread, errwrite)
  File "D:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Same error when run the unittest.

Change line 82-83 to
  output = subprocess.check_output(
      ['git', 'ls-files', '--', '*.grd'], cwd=repo_path, shell=True)
resolve the problem.

But I'm not sure if that will break other platforms.
 

Comment 1 by zmin@chromium.org, May 4 2018

Same for line 95

subprocess.check_call(command, cwd=repo_root, shell=True)

Comment 2 by zmin@chromium.org, May 4 2018

Here is an easy fix on Windows (didn't test on other platforms)

https://chromium-review.googlesource.com/c/chromium/src/+/1045550
Project Member

Comment 3 by bugdroid1@chromium.org, May 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3ada8b96802238e3b0164dcd4acf6f10ae4d863a

commit 3ada8b96802238e3b0164dcd4acf6f10ae4d863a
Author: Owen Min <zmin@chromium.org>
Date: Mon May 07 19:26:08 2018

Fix an issue for upload_screenshots.py on Windows

The script (and its unittest) doesn't run on Window. Because
the 'git' command file in depot_tool is 'git.cmd', the
|subprocess| can't find the file properly.

Bug:  840011 
Change-Id: I04762bf335b9440095971019e71de6c7038a5f3f
Reviewed-on: https://chromium-review.googlesource.com/1045550
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556524}
[modify] https://crrev.com/3ada8b96802238e3b0164dcd4acf6f10ae4d863a/tools/translation/upload_screenshots.py

Comment 4 by zmin@chromium.org, May 7 2018

Owner: zmin@chromium.org
Status: Fixed (was: Assigned)

Sign in to add a comment