From bd7a6ec567196fe23359ebda68e3485759c24220 Mon Sep 17 00:00:00 2001 From: John Chapman <jchapman@cern.ch> Date: Mon, 25 Nov 2019 13:18:49 +0100 Subject: [PATCH] Fix for python 3 syntax when writing out pkl files Updated ComponentAccumulator configuration tests which dump the configuration to a pickle file. In python3 the output file needs to be explicitly opened in binary mode. I.e. ```f = open('configdump.pkl','wb')``` rather than ```f = open('configdump.pkl','w')``` --- Database/IOVDbSvc/python/IOVDbSvcConfig.py | 2 +- TileCalorimeter/TileConditions/python/TileConditionsConfig.py | 2 +- .../TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Database/IOVDbSvc/python/IOVDbSvcConfig.py b/Database/IOVDbSvc/python/IOVDbSvcConfig.py index 912006576be1..abd1011d119c 100644 --- a/Database/IOVDbSvc/python/IOVDbSvcConfig.py +++ b/Database/IOVDbSvc/python/IOVDbSvcConfig.py @@ -250,6 +250,6 @@ if __name__ == "__main__": acc = IOVDbSvcCfg(ConfigFlags) - f=open('test.pkl','w') + f=open('test.pkl','wb') acc.store(f) f.close() diff --git a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py index 45e981925eed..9182ce5abcce 100644 --- a/TileCalorimeter/TileConditions/python/TileConditionsConfig.py +++ b/TileCalorimeter/TileConditions/python/TileConditionsConfig.py @@ -133,6 +133,6 @@ if __name__ == "__main__": acc = ComponentAccumulator() acc.merge( tileCondCfg(ConfigFlags) ) - f=open('TileCond.pkl','w') + f=open('TileCond.pkl','wb') acc.store(f) f.close() diff --git a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py index d2fbc8b8f9a1..e20475a9bc9f 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py +++ b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py @@ -287,6 +287,6 @@ if __name__ == '__main__': acc = TrackingGeometrySvcCfg(ConfigFlags ) - f=open('TrackingGeometrySvcCfg.pkl','w') + f=open('TrackingGeometrySvcCfg.pkl','wb') acc.store(f) f.close() -- GitLab