MartijnBraam / gpsd-py3

Python 3 GPSD client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random erreur, KeyError: 'climb'

all3kcis opened this issue · comments

Randomly I have the following issue : (with climb or lon)

Sats : 8
(47.884275667, 7.227755667)
0
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "*", line 63, in _readData
    data = gpsd.get_current()
  File "/usr/local/lib/python3.4/dist-packages/gpsd/__init__.py", line 267, in get_current
    return GpsResponse.from_json(response)
  File "/usr/local/lib/python3.4/dist-packages/gpsd/__init__.py", line 111, in from_json
    result.climb = last_tpv['climb']
KeyError: 'climb'

With code :

data = gpsd.get_current()
print ('mode : ' + str(data.mode))
if data.mode >= 2:
    print ('Sats : ' + str(data.sats))
    print (data.position())
    print (data.speed())

Sorry, it's look good with master version, can you update pip package ?

I have the same problem. Overwriting the local init.py with the one in the master resolved the problem

I've pushed 0.3.0 to pypi to solve this now.