[common] use with statement to open files

4 jobs for issue-73-cannot-push-a-cxx-algorithm in 4 minutes and 40 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Build
passed #204141
docker-build
build_linux_36

00:03:06

58.0%
passed #204142
docker-build
build_linux_37

00:03:04

58.0%
passed #204139
macosx
build_macosx_36

00:04:40

58.0%
passed #204140
macosx
build_macosx_37

00:04:31

58.0%