diff --git a/IPython/utils/openpy.py b/IPython/utils/openpy.py index af56811..b5a6a39 100644 --- a/IPython/utils/openpy.py +++ b/IPython/utils/openpy.py @@ -74,7 +74,7 @@ def read_py_file(filename, skip_encoding_cookie=True): A unicode string containing the contents of the file. """ filepath = Path(filename) - with filepath.open() as f: # the open function defined in this module. + with open(filepath) as f: # the open function defined in this module. if skip_encoding_cookie: return "".join(strip_encoding_cookie(f)) else: