diff --git a/gandi/cli/modules/cert.py b/gandi/cli/modules/cert.py
index <HASH>..<HASH> 100644
--- a/gandi/cli/modules/cert.py
+++ b/gandi/cli/modules/cert.py
@@ -381,7 +381,8 @@ class Certificate(GandiModule):
             csr = cls.create_csr(common_name, private_key, params)
 
         if csr and os.path.exists(csr):
-            csr = open(csr).read()
+            with open(csr) as fcsr:
+                csr = fcsr.read()
 
         return csr
Fixes issue #<I> : Tests failing with python 3