python-synology icon indicating copy to clipboard operation
python-synology copied to clipboard

TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Open Lilja opened this issue 4 years ago • 0 comments

>>> for share_uuid in api.share.shares_uuids:
...     print("Share name:        " + str(api.share.share_name(share_uuid)))
...     print("Share path:        " + str(api.share.share_path(share_uuid)))
...     print("Space used:        " + str(api.share.share_size(share_uuid, human_readable=True)))
...     print("Recycle Bin Enabled: " + str(api.share.share_recycle_bin(share_uuid)))
...     print("--")
...
Share name:        Audio
Share path:        /volume1
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/root/.cache/pypoetry/virtualenvs/syex-9TtSrW0h-py3.7/lib/python3.7/site-packages/synology_dsm/api/core/share.py", line 68, in share_size
    share_size_bytes = SynoFormatHelper.megabytes_to_bytes(share_size_mb)
  File "/root/.cache/pypoetry/virtualenvs/syex-9TtSrW0h-py3.7/lib/python3.7/site-packages/synology_dsm/helpers.py", line 45, in megabytes_to_bytes
    var_bytes = num * 1024.0 * 1024.0
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

version: python-synology-1.0.0

Lilja avatar Nov 20 '20 22:11 Lilja