Handle BOM in weather report token file
This commit is contained in:
@@ -127,7 +127,7 @@ def read_token(token_file: str) -> str:
|
|||||||
if token:
|
if token:
|
||||||
return token
|
return token
|
||||||
try:
|
try:
|
||||||
with open(token_file, "r", encoding="utf-8") as handle:
|
with open(token_file, "r", encoding="utf-8-sig") as handle:
|
||||||
token = handle.read().strip()
|
token = handle.read().strip()
|
||||||
except FileNotFoundError as exc:
|
except FileNotFoundError as exc:
|
||||||
raise WeatherReportError(
|
raise WeatherReportError(
|
||||||
|
|||||||
Reference in New Issue
Block a user