From d347c147536a4d80338a09911506f04c1c126cbd Mon Sep 17 00:00:00 2001 From: wallejak Date: Fri, 18 Jan 2019 17:41:23 +0100 Subject: [PATCH] fix the "Invalid header value" error --- aerisweather/utils/AerisNetwork.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aerisweather/utils/AerisNetwork.py b/aerisweather/utils/AerisNetwork.py index d5f9616..323d5d6 100644 --- a/aerisweather/utils/AerisNetwork.py +++ b/aerisweather/utils/AerisNetwork.py @@ -18,7 +18,7 @@ def get_json(url: str, app_id: str): req = request.Request(url) try: req.add_header('Referer', app_id) - req.add_header('User-Agent', "AerisPythonSDK/" + __version__ + "/Python/" + sys.version) + req.add_header('User-Agent', "AerisPythonSDK/" + __version__ + "/Python/" + sys.version.replace('\n', '')) except URLError: # we don't need the extra headers, so let it pass if it fails here