Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError when using ColumnShortcuts in Column UI #294

Open
HaaiHenkie opened this issue Sep 16, 2021 · 5 comments
Open

AssertionError when using ColumnShortcuts in Column UI #294

HaaiHenkie opened this issue Sep 16, 2021 · 5 comments
Labels

Comments

@HaaiHenkie
Copy link

Hello!

In approximately 30% of the times I press a column shortcut int de column UI a trace log appears and the terminal command prompt appears (i.e. topydo column UI has aborted). The exception is caused by the following error:

AssertionError
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/topydo/lib/TodoListBase.py", line 265, in linenumber
    return self._todos.index(p_todo) + 1
ValueError: <topydo.lib.Todo.Todo object at 0x7fbbdfdbc5b0> is not in list

Full trace log:
topydo0.log
This log is virtually the same for every time this error occurs.

I often use the following shortcuts on a single selected item:

  • x (do)
  • d (del)
  • ps (postpone in strict mode)
  • e (edit)

The actual command is executed successfully, only in case of edit it has no use to edit and save the todo item because the column UI has dropped out.

To startup the column UI I use topydo -a columns

I cannot find another factor that makes this error a 100% reproducible, so possibly it is partly a matter of coincidence. I realize that makes it hard to analyze this bug.

I recently switched Windows computers and from a setup with Cygwin to a setup under WSL2 (Windows Subsystem for Linux version 2). This error occurs occasionally on Cygwin and very frequent under the WSL2 setup. This is my current setup:

  • OS: Ubuntu 20.04 LTS
  • X server: VcXsrv 64-bit v1.20.9.0
  • Python 3.8 with pip user installation of all packages (to prevent conflicts with the apt package manager)
  • Terminal: gnome-terminal (it kind of works in the standard WSL2 Ubuntu terminal, but display of column UI is not completely correct)
  • Location todo.txt: local WSL2 file system (it is possible to access todo.txt on the Windows file system, but notification of file changes will not work)

Installed python packages and versions (associated with topydo[columns]):

  • topydo 0.14
  • arrow 1.1.1
  • watchdog 2.1.5
  • urwid 2.1.2
  • python-dateutil 2.8.2
  • six 1.14.0
@davesteele davesteele added the bug label Sep 16, 2021
@HaaiHenkie
Copy link
Author

I could reproduce it on Linux Mint 20.2 with same Python version and packages.

@mruwek
Copy link
Contributor

mruwek commented Sep 23, 2021

Looks like some sort of race condition in the presence of line numbers set as todo identifier. I believe setting:

[topydo]
...
identifiers = text
...

should help. Line numbers are really far from ideal as identifiers and in column-ui they can be really problematic with certain setups. We (@bram85 and I) were aware of this, but line numbers were still left as default for compatibility reasons. In my opinion they are fine only in CLI and in prompt mode. For column-ui identifiers = text is just way more safe.

@HaaiHenkie
Copy link
Author

Hi @mruwek,

I added identifiers=text to the configuration, but I still have this problem.

Cheers,

Henk

@colinsullivan
Copy link
Contributor

Adding the identifiers option to ~/.topydo fixes this for me.

[topydo]
identifiers = text

@nandoflorestan
Copy link

This crash of the columns command was driving me crazy. The workaround above works for me too. But it should not be necessary; fixing this issue with using line numbers is important because it affects new users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants