diff --git a/freqtrade/plugins/pairlist/RemotePairList.py b/freqtrade/plugins/pairlist/RemotePairList.py index 66b7d9496..2f03678e2 100644 --- a/freqtrade/plugins/pairlist/RemotePairList.py +++ b/freqtrade/plugins/pairlist/RemotePairList.py @@ -3,15 +3,16 @@ Remote PairList provider Provides pair list fetched from a remote source """ -import json import logging from pathlib import Path from typing import Any, Dict, List, Tuple +import rapidjson import requests from cachetools import TTLCache from freqtrade import __version__ +from freqtrade.configuration.load_config import CONFIG_PARSE_MODE from freqtrade.constants import Config from freqtrade.exceptions import OperationalException from freqtrade.exchange.types import Tickers @@ -236,7 +237,7 @@ class RemotePairList(IPairList): if file_path.exists(): with file_path.open() as json_file: # Load the JSON data into a dictionary - jsonparse = json.load(json_file) + jsonparse = rapidjson.load(json_file, parse_mode=CONFIG_PARSE_MODE) try: pairlist = self.process_json(jsonparse) diff --git a/tests/plugins/test_remotepairlist.py b/tests/plugins/test_remotepairlist.py index 5e6f5cbf1..9814e5662 100644 --- a/tests/plugins/test_remotepairlist.py +++ b/tests/plugins/test_remotepairlist.py @@ -35,7 +35,7 @@ def test_gen_pairlist_with_local_file(mocker, rpl_config): mock_file_path.exists.return_value = True jsonparse = json.loads(mock_file.read.return_value) - mocker.patch('freqtrade.plugins.pairlist.RemotePairList.json.load', return_value=jsonparse) + mocker.patch('freqtrade.plugins.pairlist.RemotePairList.rapidjson.load', return_value=jsonparse) rpl_config['pairlists'] = [ {