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

Crash on no repetitions for new event #18

Closed
terriblephrases opened this issue Jun 7, 2022 · 3 comments
Closed

Crash on no repetitions for new event #18

terriblephrases opened this issue Jun 7, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@terriblephrases
Copy link

I was trying out calcure, but quickly hit a crash while adding a new repeating event, after having just pressed enter when asked how many repetitions I wanted:

Traceback (most recent call last):
  File "/home/user/.local/bin/calcure", line 8, in <module>
    sys.exit(cli())
  File "/home/user/.local/lib/python3.10/site-packages/calcure/__main__.py", line 838, in cli
    curses.wrapper(main)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/user/.local/lib/python3.10/site-packages/calcure/__main__.py", line 782, in main
    control_monthly_screen(stdscr, user_events, screen, importer)
  File "/home/user/.local/lib/python3.10/site-packages/calcure/controls.py", line 113, in control_monthly_screen
    if reps > 0 and freq is not None:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

The crash is an easy fix, but it looks like it's impossible at the moment to make an infinitely repeating event except by adding anniversaries in abook, or somehow adding them in the holidays package?

@terriblephrases terriblephrases changed the title Crash on no repetitions for new events Crash on no repetitions for new event Jun 7, 2022
@anufrievroman
Copy link
Owner

Thank you for reporting, indeed it crashes on empty number of repetitions. I'll fix it, it is easy.

About the infinite repetitions, it can't be done due to current design (there's actual list of all events created), however it can be a large number. Currently the maximum is 100, but I'll increase it to 10000 or something large (I'll test how it works with memory).

@terriblephrases
Copy link
Author

Ah, I see. What I was trying to do was just to add indefinitely repeating yearly events that weren't covered by abook or holidays but I suppose even 100 would be sufficient for practical purposes, really.

@anufrievroman
Copy link
Owner

anufrievroman commented Jun 9, 2022

Yes, actually the maximum is 999 repetitions, which is probably okay for all practical purposes.
By the way, commit 3920653 fixes the mentioned bug. It is fixed in version 2.1. Thank you again for reporting.

@anufrievroman anufrievroman added the bug Something isn't working label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants