Skip to content

chore: make code PEP597 compliant #2201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2022
Merged
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 gitlab/config.py
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ def __init__(

def _parse_config(self) -> None:
_config = configparser.ConfigParser()
_config.read(self._files)
_config.read(self._files, encoding="utf-8")

if self.gitlab_id and not _config.has_section(self.gitlab_id):
raise GitlabDataError(
2 changes: 1 addition & 1 deletion tests/meta/test_v4_objects_imported.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ def test_verify_v4_objects_imported() -> None:
assert len(gitlab.v4.objects.__path__) == 1

init_files: Set[str] = set()
with open(gitlab.v4.objects.__file__, "r") as in_file:
with open(gitlab.v4.objects.__file__, "r", encoding="utf-8") as in_file:
for line in in_file.readlines():
if line.startswith("from ."):
init_files.add(line.rstrip())
2 changes: 1 addition & 1 deletion tests/unit/objects/test_packages.py
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ def test_delete_project_package_file_from_package_file_object(

def test_upload_generic_package(tmp_path, project, resp_upload_generic_package):
path = tmp_path / file_name
path.write_text(file_content)
path.write_text(file_content, encoding="utf-8")
package = project.generic_packages.upload(
package_name=package_name,
package_version=package_version,
3 changes: 2 additions & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
@@ -290,7 +290,8 @@ def test_data_from_helper(m_open, monkeypatch, tmp_path):
#!/bin/sh
echo "secret"
"""
)
),
encoding="utf-8",
)
helper.chmod(0o755)