9
9
import tables
10
10
import numpy as np
11
11
import pandas as pd
12
+ from urllib .parse import urljoin
12
13
13
14
from pvoutput .exceptions import NoStatusFound , RateLimitExceeded
14
15
from pvoutput .utils import _get_response , _get_param_from_config_file
@@ -85,6 +86,8 @@ def __init__(self,
85
86
'data_service_url' , config_filename )
86
87
except KeyError :
87
88
pass
89
+ except FileNotFoundError :
90
+ pass
88
91
89
92
if self .data_service_url is not None :
90
93
if not self .data_service_url .strip ('/' ).endswith ('.org' ):
@@ -816,8 +819,7 @@ def _get_api_response(self,
816
819
'X-Pvoutput-Apikey' : self .api_key ,
817
820
'X-Pvoutput-SystemId' : self .system_id }
818
821
819
- api_url = os .path .join (
820
- BASE_URL , 'service/r2/{}.jsp' .format (service ))
822
+ api_url = urljoin (BASE_URL , 'service/r2/{}.jsp' .format (service ))
821
823
822
824
return _get_response (api_url , api_params , headers )
823
825
@@ -840,7 +842,7 @@ def _get_data_service_response(self,
840
842
api_params ['key' ] = self .api_key
841
843
api_params ['sid' ] = self .system_id
842
844
843
- api_url = os . path . join (
845
+ api_url = urljoin (
844
846
self .data_service_url , 'service/r2/{}.jsp' .format (service ))
845
847
846
848
return _get_response (api_url , api_params , headers )
0 commit comments