UCLA-IRL / ndn-python-repo

An NDN Repo implementation in Python
Apache License 2.0
16 stars 13 forks source link

TypeError: 'NoneType' object cannot be interpreted as an integer #22

Closed Pesa closed 4 years ago

Pesa commented 4 years ago

I was running examples/delfile.py and got the following exception in ndn-python-repo process:

[2020-02-23 14:12:37]INFO:Delete handle processing delete command: [<memory at 0x7fa87abd06d0>, <memory at 0x7fa87abd07a0>, <memory at 0x7fa87abd0870>], None, None
[2020-02-23 14:12:37]INFO:Reply to command: /testrepo/delete/%07%10%08%02my%08%07license%08%014
[2020-02-23 14:12:37]ERROR:Task exception was never retrieved
future: <Task finished coro=<DeleteCommandHandle._process_delete() done, defined at /home/davide/.local/lib/python3.7/site-packages/ndn_python_repo/handle/delete_command_handle.py:43> exception=TypeError("'NoneType' object cannot be interpreted as an integer")>
Traceback (most recent call last):
  File "/home/davide/.local/lib/python3.7/site-packages/ndn_python_repo/handle/delete_command_handle.py", line 70, in _process_delete
    delete_num = await self._perform_storage_delete(name, start_block_id, end_block_id)
  File "/home/davide/.local/lib/python3.7/site-packages/ndn_python_repo/handle/delete_command_handle.py", line 93, in _perform_storage_delete
    for idx in range(start_block_id, end_block_id + 1):
TypeError: 'NoneType' object cannot be interpreted as an integer

This problem essentially makes delfile.py unusable.

JonnyKong commented 4 years ago

Sorry but I cannot reproduce this error.

Looking at the line numbers in your exception, it seems that you're running an outdated version from last week?

Pesa commented 4 years ago
$ pip3 install ndn-python-repo -U
Requirement already up-to-date: ndn-python-repo in /home/davide/.local/lib/python3.7/site-packages (0.1a5)
...
JonnyKong commented 4 years ago

$ pip3 install ndn-python-repo -U Requirement already up-to-date: ndn-python-repo in /home/davide/.local/lib/python3.7/site-packages (0.1a5) ...

I haven't updated the PyPI version yet. I will do so after resolving the remaining issues.

Pesa commented 4 years ago

Ok, I installed from my local git clone and the error is gone.

Pesa commented 4 years ago

Well, the exception is gone but the example still doesn't work, see #24