[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 Name Job ID Coverage
  Build
passed build_linux_36 #204141
docker-build

00:03:06

58.0%
passed build_linux_37 #204142
docker-build

00:03:04

58.0%
passed build_macosx_36 #204139
macosx

00:04:40

58.0%
passed build_macosx_37 #204140
macosx

00:04:31

58.0%