New issue
Advanced search Search tips

Issue 846383 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Aug 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 842802



Sign in to add a comment

raw_io/api.py throws on read-only files on Windows

Project Member Reported by mar...@chromium.org, May 24 2018

Issue description

https://cs.chromium.org/chromium/infra/recipes-py/recipe_modules/raw_io/api.py?l=191

This is due to the use of shutil.rmtree() which doesn't handle read-only bit on Windows.

swarming client code has a quite intense rmtree() implementation that works around all kind of known issues.
https://cs.chromium.org/chromium/infra/luci/client/utils/file_path.py?l=1157

In practice we do not the recipe to run code as misbehaved as Swarming can expect (e.g. tests creating files as root). As such, we should just tweak the function to handle read-only files and this would be sufficient.

This is currently happening while trying to roll recent swarming client code into chromium src, which creates read-only files where it used to not do.
 

Comment 1 by mar...@chromium.org, May 24 2018

Blocking: 842802
Project Member

Comment 2 by bugdroid1@chromium.org, May 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/recipes-py/+/611cfbdc328b50144e2790ed1e4b9db24adb9eea

commit 611cfbdc328b50144e2790ed1e4b9db24adb9eea
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Thu May 24 19:50:05 2018

[raw_io] Make it succeed even with read only files.

Use a simplified algorithm compared to swarming's client file_path.py, as we
don't expect the steps here to be as egregious in the file ACL than what
Swarming tasks can do.

Tested manually on Windows by copy pasting the code, creating a directory and a
file in it, running 'attrib +r' on the file. Testing with and without the
onerror handler.

Bug:  846383 
Change-Id: I13181eb381edb360cbbe69d95c36a266ffb8bb03
Reviewed-on: https://chromium-review.googlesource.com/1072068
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/611cfbdc328b50144e2790ed1e4b9db24adb9eea/recipe_modules/raw_io/api.py

Should we mark this fixed? I was searching for an unrelated bug, and noticed this looks like it could be closed.
Status: Fixed (was: Assigned)
Yeah looks fixed to me

Sign in to add a comment