Skip to content

Commit

Permalink
{Misc} Don't use aliased io.open (Azure#30448)
Browse files Browse the repository at this point in the history
  • Loading branch information
atombrella authored Dec 4, 2024
1 parent 90ae068 commit dc7a517
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
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

0 comments on commit dc7a517

Please sign in to comment.