diff --git a/docs/release.rst b/docs/release.rst index 2f64454c97..751e6ca0b1 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -11,6 +11,12 @@ Release notes Unreleased ---------- + Maintenance + ~~~~~~~~~~~ + + * Change occurrence of io.open() into open(). + By :user:`Dimitri Papadopoulos Orfanos ` :issue:`1421`. + .. _release_2.15.0: 2.15.0 diff --git a/zarr/convenience.py b/zarr/convenience.py index 9a0eae20a3..bb00621412 100644 --- a/zarr/convenience.py +++ b/zarr/convenience.py @@ -1,5 +1,4 @@ """Convenience functions for storing and loading data.""" -import io import itertools import os import re @@ -23,6 +22,8 @@ StoreLike = Union[BaseStore, MutableMapping, str, None] +_builtin_open = open # builtin open is shadowed by a local open function 🤯 + def _check_and_update_path(store: BaseStore, path): if getattr(store, '_store_version', 2) > 2 and not path: @@ -485,7 +486,7 @@ def __init__(self, log): elif callable(log): self.log_func = log elif isinstance(log, str): - self.log_file = io.open(log, mode='w') + self.log_file = _builtin_open(log, mode='w') self.needs_closing = True elif hasattr(log, 'write'): self.log_file = log