Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit433dba0

Browse files
chore: make code PEP597 compliant
Use `encoding="utf-8"` in `open()` and open-like functions.https://peps.python.org/pep-0597/
1 parent8ba97aa commit433dba0

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

‎gitlab/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __init__(
135135

136136
def_parse_config(self)->None:
137137
_config=configparser.ConfigParser()
138-
_config.read(self._files)
138+
_config.read(self._files,encoding="utf-8")
139139

140140
ifself.gitlab_idandnot_config.has_section(self.gitlab_id):
141141
raiseGitlabDataError(

‎tests/meta/test_v4_objects_imported.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_verify_v4_objects_imported() -> None:
1313
assertlen(gitlab.v4.objects.__path__)==1
1414

1515
init_files:Set[str]=set()
16-
withopen(gitlab.v4.objects.__file__,"r")asin_file:
16+
withopen(gitlab.v4.objects.__file__,"r",encoding="utf-8")asin_file:
1717
forlineinin_file.readlines():
1818
ifline.startswith("from ."):
1919
init_files.add(line.rstrip())

‎tests/unit/objects/test_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_delete_project_package_file_from_package_file_object(
276276

277277
deftest_upload_generic_package(tmp_path,project,resp_upload_generic_package):
278278
path=tmp_path/file_name
279-
path.write_text(file_content)
279+
path.write_text(file_content,encoding="utf-8")
280280
package=project.generic_packages.upload(
281281
package_name=package_name,
282282
package_version=package_version,

‎tests/unit/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ def test_data_from_helper(m_open, monkeypatch, tmp_path):
290290
#!/bin/sh
291291
echo "secret"
292292
"""
293-
)
293+
),
294+
encoding="utf-8",
294295
)
295296
helper.chmod(0o755)
296297

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp