Broken when new event on Termux
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
I installed khal on Termux of my Android phone (EMUI 10.0.0) via pip install khal, and created a config file following the instruction. khal calendar works.
After setting the default calendar, I tried khal new 13:30 lunch and I got these:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/khal", line 8, in <module>
sys.exit(main_khal())
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/cli.py", line 386, in new
new_func(
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/controllers.py", line 353, in new_from_string
new_from_args(
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/controllers.py", line 379, in new_from_args
collection.new(event)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/khalendar/khalendar.py", line 207, in new
event.href, event.etag = self._storages[calendar].upload(event)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/khalendar/vdir.py", line 214, in upload
fpath, etag = self._upload_impl(item, href)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/khal/khalendar/vdir.py", line 233, in _upload_impl
return fpath, get_etag_from_file(f)
File "/data/data/com.termux/files/usr/lib/python3.9/contextlib.py", line 124, in __exit__
next(self.gen)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/atomicwrites/__init__.py", line 169, in _open
self.commit(f)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/atomicwrites/__init__.py", line 204, in commit
move_atomic(f.name, self._path)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/atomicwrites/__init__.py", line 111, in move_atomic
return _move_atomic(src, dst)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/atomicwrites/__init__.py", line 59, in _move_atomic
os.link(src, dst)
AttributeError: module 'os' has no attribute 'link'
And the following is what I wrote in my config file:
[calendars]
[[private]]
path = ~/.config/khal/private
type = calendar
color = yellow
[default]
default_calendar = private
highlight_event_days = True
[highlight_days]
color = light blue
default_color = yellow
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M
I don't know if it is about the OS. Please help me!
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
Start with the traceback path through khal/controllers.py, khal/khalendar/khalendar.py, and khal/khalendar/vdir.py, then inspect the atomicwrites operation that calls os.link. Reproduce event creation on Termux and determine the project's expected handling for this unsupported operation; done should mean the behavior is resolved or clearly reported with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100