khal adding new issue doesnt work with weekly flag
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
Im am trying to create a weekly recurring task for khal, but its crashing due to some timezone issue
command used
khal new -a private 06/04/2023 sample task -r weekly
log
Traceback (most recent call last):
File "/usr/bin/khal", line 5, in <module>
main_khal()
File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/lib/python3.10/site-packages/khal/cli.py", line 394, in new
new_func(
File "/usr/lib/python3.10/site-packages/khal/controllers.py", line 378, in new_from_string
new_from_args(
File "/usr/lib/python3.10/site-packages/khal/controllers.py", line 393, in new_from_args
event = new_vevent(
File "/usr/lib/python3.10/site-packages/khal/icalendar.py", line 132, in new_event
rrule = rrulefstr(repeat, until, locale, dtstart.tzinfo)
AttributeError: 'datetime.date' object has no attribute 'tzinfo'
khal config
[calendars]
[[private]]
path = /home/kushy/.local/share/khal/calendars/private
type = calendar
[locale]
timeformat = %I:%M %p
dateformat = %d/%m/%Y
longdateformat = %d/%m/%Y
datetimeformat = %d/%m/%Y %I:%M %p
longdatetimeformat = %d/%m/%Y %I:%M %p
[default]
default_calendar = private
command works, if i remove -r weekly , or give it a time
khal new -a private 06/04/2023 08:00 AM sample task -r weekly
shouldnt it be picking up my local time ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the reported khal new -a private 06/04/2023 sample task -r weekly command, then inspect khal/icalendar.py at new_event and the rrulefstr call shown in the traceback. Compare it with the working command that includes a time. Done means weekly creation without an explicit time no longer raises the reported datetime.date/tzinfo error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100