Skip to content

Commit

Permalink
Fix bug preventing updating protobuf library. (#3249)
Browse files Browse the repository at this point in the history
The protbuf library writes some write protected files that needed to be
removed before written to.
  • Loading branch information
jonathanmetzman committed Jul 25, 2023
1 parent bb33f51 commit 157abf2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/clusterfuzz/_internal/bot/tasks/update_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ def update_source_code():
'version.' % absolute_filepath)

try:
extracted_path = zip_archive.extract(filepath, output_directory)
try:
extracted_path = zip_archive.extract(filepath, output_directory)
except PermissionError:
# Deal with write-protected files in protobuf package.
os.remove(absolute_filepath)
extracted_path = zip_archive.extract(filepath, output_directory)
external_attr = zip_archive.getinfo(filepath).external_attr
mode = (external_attr >> 16) & 0o777
mode |= 0o440
Expand Down

0 comments on commit 157abf2

Please sign in to comment.