Skip to content

Commit 07a2fa1

Browse files
rabinadk1bbc2
authored andcommitted
Use open instead of io.open
1 parent 65dfa71 commit 07a2fa1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import io
21
from setuptools import setup
32

43

54
def read_files(files):
65
data = []
76
for file in files:
8-
with io.open(file, encoding='utf-8') as f:
7+
with open(file, encoding='utf-8') as f:
98
data.append(f.read())
109
return "\n".join(data)
1110

1211

1312
long_description = read_files(['README.md', 'CHANGELOG.md'])
1413

1514
meta = {}
16-
with io.open('./src/dotenv/version.py', encoding='utf-8') as f:
15+
with open('./src/dotenv/version.py', encoding='utf-8') as f:
1716
exec(f.read(), meta)
1817

1918
setup(

src/dotenv/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
@contextmanager
5252
def _get_stream(self) -> Iterator[IO[str]]:
5353
if self.dotenv_path and os.path.isfile(self.dotenv_path):
54-
with io.open(self.dotenv_path, encoding=self.encoding) as stream:
54+
with open(self.dotenv_path, encoding=self.encoding) as stream:
5555
yield stream
5656
elif self.stream is not None:
5757
yield self.stream
@@ -129,10 +129,10 @@ def rewrite(
129129
) -> Iterator[Tuple[IO[str], IO[str]]]:
130130
try:
131131
if not os.path.isfile(path):
132-
with io.open(path, "w+", encoding=encoding) as source:
132+
with open(path, "w+", encoding=encoding) as source:
133133
source.write("")
134134
with tempfile.NamedTemporaryFile(mode="w+", delete=False, encoding=encoding) as dest:
135-
with io.open(path, encoding=encoding) as source:
135+
with open(path, encoding=encoding) as source:
136136
yield (source, dest) # type: ignore
137137
except BaseException:
138138
if os.path.isfile(dest.name):

0 commit comments

Comments
 (0)