matbarofex/pyRofex

KeyError: 'x-auth-token'

Closed this issue · 2 comments

Describe the bug
Cuando inicializo una instancia de pyRofex me devuelve el siguiente error :

C:\Users\Ale10\Anaconda3\envs\IB-tws\lib\site-packages\urllib3\connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,
C:\Users\Ale10\Anaconda3\envs\IB-tws\lib\site-packages\urllib3\connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,

KeyError Traceback (most recent call last)
in
3 password=passw,
4 account=account,
----> 5 environment=pyRofex.Environment.REMARKET)

~\Anaconda3\envs\IB-tws\lib\site-packages\pyRofex\service.py in initialize(user, password, account, environment)
38 :type proxies: dict
39 """
---> 40 _validate_environment(environment)
41 _set_environment_parameters(user, password, account, environment, proxies)
42 globals.environment_config[environment]["rest_client"] = RestClient(environment)

~\Anaconda3\envs\IB-tws\lib\site-packages\pyRofex\clients\rest_rfx.py in init(self, environment)
32
33 # Get the authentication Token.
---> 34 self.update_token()
35
36 def get_trade_history(self, ticker, start_date, end_date, market):

~\Anaconda3\envs\IB-tws\lib\site-packages\pyRofex\clients\rest_rfx.py in update_token(self)
268
269 if not response.ok:
--> 270 raise ApiException("Authentication fails. Incorrect User or Password")
271
272 self.environment["token"] = response.headers['X-Auth-Token']

~\Anaconda3\envs\IB-tws\lib\site-packages\requests\structures.py in getitem(self, key)
50
51 def getitem(self, key):
---> 52 return self._store[key.lower()][1]
53
54 def delitem(self, key):

KeyError: 'x-auth-token'

Hola Alejandro, que versión de la librearía estas utilizando? En la versión 0.3.0, se soluciono un cambio que hicieron con la API de Remarket para conexiones HTTPS.

Todo parece indicar que ejecutando el siguiente comando se soluciona:
pip install -U pyRofex

Avisame cualquier cosa.

Gracias por la info, tema resuelto.