Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyperformance/_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _iter_sections(lines):
def _parse_manifest_file(filename):
relroot = os.path.dirname(filename)
filename = _utils.resolve_file(filename, relroot)
with open(filename) as infile:
with open(filename, encoding="utf-8") as infile:
yield from _parse_manifest(infile, filename)


Expand Down
2 changes: 1 addition & 1 deletion pyperformance/_pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def load_pyproject_toml(filename, *, name=None, tools=None, requirefiles=True):
else:
rootdir = os.path.dirname(filename)

with open(filename) as infile:
with open(filename, encoding="utf-8") as infile:
text = infile.read()
data = parse_pyproject_toml(text, rootdir, name,
tools=tools,
Expand Down
2 changes: 1 addition & 1 deletion pyperformance/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def parse_selections(selections, parse_entry=None):


def iter_clean_lines(filename):
with open(filename) as reqsfile:
with open(filename, encoding="utf-8") as reqsfile:
for line in reqsfile:
# strip comment
line = line.partition('#')[0]
Expand Down
3 changes: 1 addition & 2 deletions pyperformance/tests/test_compare.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import io
import os.path
import subprocess
import sys
Expand Down Expand Up @@ -135,7 +134,7 @@ def test_csv(self):
with tests.temporary_file() as tmp:
self.compare("--csv", tmp)

with io.open(tmp, "r") as fp:
with open(tmp, "r", encoding="utf-8") as fp:
csv = fp.read()

self.assertEqual(csv,
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@
# put most of the code inside main() to be able to import setup.py in
# unit tests
def main():
import io
import os.path
from setuptools import setup, find_packages

with io.open('README.rst', encoding="utf8") as fp:
with open('README.rst', encoding="utf8") as fp:
long_description = fp.read().strip()

options = {
Expand Down