diff --git a/setup.py b/setup.py
index 80fa724d656288d9ccc448266619e4172db35e8e..1f7faae82843cc2e977b858a0651673b1d18dd74 100644
--- a/setup.py
+++ b/setup.py
@@ -145,7 +145,7 @@ def main():
             if "isl_ast_int.c" in fn and conf["USE_SHIPPED_IMATH"]:
                 continue
 
-            inf = open(fn, "rt", codec="utf-8")
+            inf = open(fn, "rt", encoding="utf-8")
             try:
                 contents = inf.read()
             finally: