• Mustafa Emre Acer's avatar
    Fix crash in translation screenshot presubmit · d697ac9f
    Mustafa Emre Acer authored
    The presubmit code for translation screenshots parses grd and grdp files
    modified in the CL. It does this by referring to the old and new
    contents of the files passed to it by the presubmit.
    
    grd files can refer to grdp files via <part> tags. This causes the
    messages in the grdp file to be included in the grd file. If a modified
    grd file's old contents refers to a now renamed or deleted grdp file,
    grd reader fails to open the grdp and crashes.
    
    This CL fixes this by ignoring <part> tags while loading grd files.
    This should be safe: The presubmit processes grdp files separately, so
    all grdp files should still be processed, just not when loading grd
    files. Additionally, grdp files cannot contain part files, so
    ignoring the tag while loading grdp files should also be safe.
    
    Bug: 1047487
    Change-Id: I3d79aa028c4ae360d74a437a019628d0bdab494a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037027Reviewed-by: default avataranthonyvd <anthonyvd@chromium.org>
    Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
    Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#739040}
    d697ac9f
grd_helper.py 3.03 KB