question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError during first sync

See original GitHub issue

I’ve downloaded the latest pip version and started a sync from Withings to Garmin (with option -f 2016-01-01)

I’m getting the following error:

2022-07-07 10:47:32,697 - withings - INFO - Get Measurements
Traceback (most recent call last):
  File "/Users/robertvh/Library/Python/3.9/bin/./withings-sync", line 8, in <module>
    sys.exit(main())
  File "/Users/robertvh/Library/Python/3.9/lib/python/site-packages/withings_sync/sync.py", line 396, in main
    sync()
  File "/Users/robertvh/Library/Python/3.9/lib/python/site-packages/withings_sync/sync.py", line 349, in sync
    last_weight, last_date_time, syncdata = prepare_syncdata(height, groups)
  File "/Users/robertvh/Library/Python/3.9/lib/python/site-packages/withings_sync/sync.py", line 248, in prepare_syncdata
    groupdata["weight"] / pow(groupdata["height"], 2), 1
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

It looks like the Withings API is returning entries with weight = null.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
haapmikcommented, Jul 13, 2022

@longstone : I tested that PR #76 and it fixes the problem.

1reaction
haapmikcommented, Jul 11, 2022

I also get the same error message with version 3.4.2.

This can be fixed by changing line 246 if height and "weight" in groupdata: to if height and groupdata["weight"]: in withings-sync/sync.py:

        if height and groupdata["weight"]:
            groupdata["bmi"] = round(
                groupdata["weight"] / pow(groupdata["height"], 2), 1
            )
Read more comments on GitHub >

github_iconTop Results From Across the Web

BrowserSync throws a TypeError on init - Stack Overflow
After rechecking the docs, it the task is setup correctly. Any idea what could be causing this type error? Opened github issue: https://github....
Read more >
Error while starting Sync: d is not iterable #103839 - GitHub
I have two machines on which I have VS Code installed. In the machine A, which I synced first, there was an empty...
Read more >
TypeError: Cannot read property 'sync' of undefined | Medium
In this post am going to share the possibility of the “TypeError: Cannot read property 'sync' of undefined”. The error above can be...
Read more >
Sync-Unicorn' errored "Cannot read property '0' of undefined ...
The problem is that unicorn sync can't find your Shared key. Does the config file exist in your website. Please make sure this...
Read more >
for await...of - JavaScript - MDN Web Docs
When a for await...of loop iterates over an iterable, it first gets the ... for await...of works on both sync and async iterables, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found