| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 618267c commit dc32d54
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -257,8 +257,8 @@ def _parse_value(v: Any) -> Any: | |||
| 257 | 257 | # If the user-provided value starts with @, we try to read the file | |
| 258 | 258 | # path provided after @ as the real value. Exit on any error. | |
| 259 | 259 | try: | |
| 260 | - with open(v[1:]) as fl: | ||
| 261 | - return fl.read() | ||
| 260 | + with open(v[1:]) as f: | ||
| 261 | + return f.read() | ||
| 262 | 262 | except Exception as e: | |
| 263 | 263 | sys.stderr.write(f"{e}\n") | |
| 264 | 264 | sys.exit(1) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,16 +6,16 @@ | |||
| 6 | 6 | ||
| 7 | 7 | def get_version() -> str: | |
| 8 | 8 | version = "" | |
| 9 | - with open("gitlab/_version.py") as f: | ||
| 9 | + with open("gitlab/_version.py", "r", encoding="utf-8") as f: | ||
| 10 | 10 | for line in f: | |
| 11 | 11 | if line.startswith("__version__"): | |
| 12 | 12 | version = eval(line.split("=")[-1]) | |
| 13 | 13 | break | |
| 14 | 14 | return version | |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | - with open("README.rst", "r") as readme_file: | ||
| 18 | - readme = readme_file.read() | ||
| 17 | + with open("README.rst", "r", encoding="utf-8") as f: | ||
| 18 | + readme = f.read() | ||
| 19 | 19 | ||
| 20 | 20 | setup( | |
| 21 | 21 | name="python-gitlab", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ def set_token(container, fixture_dir): | |||
| 87 | 87 | logging.info("Creating API token.") | |
| 88 | 88 | set_token_rb = fixture_dir / "set_token.rb" | |
| 89 | 89 | ||
| 90 | - with open(set_token_rb, "r") as f: | ||
| 90 | + with open(set_token_rb, "r", encoding="utf-8") as f: | ||
| 91 | 91 | set_token_command = f.read().strip() | |
| 92 | 92 | ||
| 93 | 93 | rails_command = [ | |
@@ -206,7 +206,7 @@ def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, fixture_ | |||
| 206 | 206 | private_token = {token} | |
| 207 | 207 | api_version = 4""" | |
| 208 | 208 | ||
| 209 | - with open(config_file, "w") as f: | ||
| 209 | + with open(config_file, "w", encoding="utf-8") as f: | ||
| 210 | 210 | f.write(config) | |
| 211 | 211 | ||
| 212 | 212 | return config_file | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,8 +12,8 @@ | |||
| 12 | 12 | ||
| 13 | 13 | @pytest.fixture() | |
| 14 | 14 | def json_content(fixture_dir): | |
| 15 | - with open(fixture_dir / "todo.json", "r") as json_file: | ||
| 16 | - todo_content = json_file.read() | ||
| 15 | + with open(fixture_dir / "todo.json", "r", encoding="utf-8") as f: | ||
| 16 | + todo_content = f.read() | ||
| 17 | 17 | return json.loads(todo_content) | |
| 18 | 18 | ||
| 19 | 19 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments