pimutils / pimutils/khal

khal adding new issue doesnt work with weekly flag

Open
#1,231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.