aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/valentines
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-05-25 10:34:52 +0100
committerGravatar GitHub <[email protected]>2020-05-25 10:34:52 +0100
commitbb30d2904b4a3273d4b10dc9548c542d65f0c379 (patch)
treee6bf89e968dd39a153227aa8ca060496d2c3cbec /bot/exts/valentines
parentMerge pull request #401 from fuzzmz/minesweeper-disabled-dm-handling (diff)
parentRemove accidental extra word from docstring (diff)
Merge pull request #413 from jodth07/encoding_bug_fix
Encoding bug fix
Diffstat (limited to 'bot/exts/valentines')
-rw-r--r--bot/exts/valentines/be_my_valentine.py2
-rw-r--r--bot/exts/valentines/lovecalculator.py2
-rw-r--r--bot/exts/valentines/myvalenstate.py2
-rw-r--r--bot/exts/valentines/valentine_zodiac.py2
-rw-r--r--bot/exts/valentines/whoisvalentine.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/valentines/be_my_valentine.py b/bot/exts/valentines/be_my_valentine.py
index e5e71d25..b1258307 100644
--- a/bot/exts/valentines/be_my_valentine.py
+++ b/bot/exts/valentines/be_my_valentine.py
@@ -27,7 +27,7 @@ class BeMyValentine(commands.Cog):
def load_json() -> dict:
"""Load Valentines messages from the static resources."""
p = Path("bot/resources/valentines/bemyvalentine_valentines.json")
- with p.open() as json_data:
+ with p.open(encoding="utf8") as json_data:
valentines = load(json_data)
return valentines
diff --git a/bot/exts/valentines/lovecalculator.py b/bot/exts/valentines/lovecalculator.py
index e11e062b..c75ea6cf 100644
--- a/bot/exts/valentines/lovecalculator.py
+++ b/bot/exts/valentines/lovecalculator.py
@@ -15,7 +15,7 @@ from bot.constants import Roles
log = logging.getLogger(__name__)
-with Path("bot/resources/valentines/love_matches.json").open() as file:
+with Path("bot/resources/valentines/love_matches.json").open(encoding="utf8") as file:
LOVE_DATA = json.load(file)
LOVE_DATA = sorted((int(key), value) for key, value in LOVE_DATA.items())
diff --git a/bot/exts/valentines/myvalenstate.py b/bot/exts/valentines/myvalenstate.py
index 7d8737c4..01801847 100644
--- a/bot/exts/valentines/myvalenstate.py
+++ b/bot/exts/valentines/myvalenstate.py
@@ -11,7 +11,7 @@ from bot.constants import Colours
log = logging.getLogger(__name__)
-with open(Path("bot/resources/valentines/valenstates.json"), "r") as file:
+with open(Path("bot/resources/valentines/valenstates.json"), "r", encoding="utf8") as file:
STATES = json.load(file)
diff --git a/bot/exts/valentines/valentine_zodiac.py b/bot/exts/valentines/valentine_zodiac.py
index 1a1273aa..ef9ddc78 100644
--- a/bot/exts/valentines/valentine_zodiac.py
+++ b/bot/exts/valentines/valentine_zodiac.py
@@ -25,7 +25,7 @@ class ValentineZodiac(commands.Cog):
def load_json() -> dict:
"""Load zodiac compatibility from static JSON resource."""
p = Path("bot/resources/valentines/zodiac_compatibility.json")
- with p.open() as json_data:
+ with p.open(encoding="utf8") as json_data:
zodiacs = load(json_data)
return zodiacs
diff --git a/bot/exts/valentines/whoisvalentine.py b/bot/exts/valentines/whoisvalentine.py
index 4ca0289c..0ff9186c 100644
--- a/bot/exts/valentines/whoisvalentine.py
+++ b/bot/exts/valentines/whoisvalentine.py
@@ -10,7 +10,7 @@ from bot.constants import Colours
log = logging.getLogger(__name__)
-with open(Path("bot/resources/valentines/valentine_facts.json"), "r") as file:
+with open(Path("bot/resources/valentines/valentine_facts.json"), "r", encoding="utf8") as file:
FACTS = json.load(file)