[PATCH 6.1 136/143] scripts: handle BrokenPipeError for python scripts