Skip to content
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

{Misc} Don't use aliased io.open #30448

Merged
merged 1 commit into from
Dec 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import os
import re
import codecs
from io import open
import requests
from knack.log import get_logger
from knack.util import CLIError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# pylint: disable=line-too-long,too-many-nested-blocks,too-many-lines,too-many-return-statements

import io
import json
from itertools import chain
from json import JSONDecodeError
Expand Down Expand Up @@ -91,7 +90,7 @@ def __read_with_appropriate_encoding(file_path, format_):
detected_encoding = __check_file_encoding(file_path)

try:
with io.open(file_path, 'r', encoding=default_encoding) as config_file:
with open(file_path, 'r', encoding=default_encoding) as config_file:
if format_ == 'json':
config_data = json.load(config_file)
# Only accept json objects
Expand All @@ -110,7 +109,7 @@ def __read_with_appropriate_encoding(file_path, format_):
if detected_encoding == default_encoding:
raise

with io.open(file_path, 'r', encoding=detected_encoding) as config_file:
with open(file_path, 'r', encoding=detected_encoding) as config_file:
if format_ == 'json':
config_data = json.load(config_file)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
import re
import codecs
from io import open
import requests
from knack.log import get_logger
from azure.core.exceptions import HttpResponseError
Expand Down