akapur / pyiqfeed

Python LIbrary for reading DTN's IQFeed
GNU General Public License v2.0
168 stars 108 forks source link

example.py IndexError on historical functions #50

Closed mikemilano closed 3 years ago

mikemilano commented 3 years ago

iqfeed client version: 6.0.1.1

I can successfully run the functions above historical (like level 1, regional, etc), but when running python examples.py -k (or historical bars/daily), I get an error thrown from conn.py. I tried changing the symbol and get the same result.

$ python example.py -k
Exception in thread pyiqfeed-Example-tickdata-reader:
Traceback (most recent call last):
  File "[path-to-interpreter]/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "[path-to-interpreter]/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "[path-to-repo]/pyiqfeed/pyiqfeed/conn.py", line 201, in __call__
    self._process_messages()
  File "[path-to-repo]/pyiqfeed/pyiqfeed/conn.py", line 248, in _process_messages
    handle_func(fields)
  File "[path-to-repo]/pyiqfeed/pyiqfeed/conn.py", line 1724, in _process_datum
    if 'E' == fields[1]:
IndexError: list index out of range

The code that causes this is in conn.py

    def _process_datum(self, fields: Sequence[str]) -> None:
        req_id = fields[0]
        if 'E' == fields[1]:

There is only 1 value in the fields argument: ['HTTP/1.1 400']

I looked at all other messages processed in _process_messages(), but there's only 1 other: Server: WebSocket++/0.7.0

Is there anything else I can do to find more information on this error?

mikemilano commented 3 years ago

This ended up being a conflict with another service on my system related to port 9100. Tick data works fine; Closing issue.