pimutils / pimutils/vdirsyncer
Syncing fails on an Android/termux as os.link is not available
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 185
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 1
Description
Vdirsyncer fails syncing on Android in termux due to os.link not being available in the python build of termux/Android (see termux/termux-packages#29 for details). os.link is used in the atomicwrites library as it can be seen in the traceback below:
Copying (uploading) item e9213c2c-7cf4-4728-b1c4-45781d92267f to my_calendar_local/contact_birthdays
error: Unknown error occured for my_calendar/contact_birthdays: module 'os' has no attribute 'link'
error: Use `-vdebug` to see the full traceback.
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/cli/utils.py", line 74, in handle_cli_error
debug: raise e
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 153, in sync
debug: partial_sync
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 177, in run
debug: self._run_impl(a, b)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 204, in _run_impl
debug: href, etag = self.dest.storage.upload(self.item)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/storage/base.py", line 15, in inner
debug: return f(self, *args, **kwargs)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/storage/filesystem.py", line 126, in upload
debug: fpath, etag = self._upload_impl(item, href)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/vdirsyncer/storage/filesystem.py", line 149, in _upload_impl
debug: return fpath, get_etag_from_file(f)
debug: File "/data/data/com.termux/files/usr/lib/python3.6/contextlib.py", line 88, in __exit__
debug: next(self.gen)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/atomicwrites/__init__.py", line 152, in _open
debug: self.commit(f)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/atomicwrites/__init__.py", line 179, in commit
debug: move_atomic(f.name, self._path)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/atomicwrites/__init__.py", line 101, in move_atomic
debug: return _move_atomic(src, dst)
debug: File "/data/data/com.termux/files/home/.local/venvs/vdirsyncer/lib/python3.6/site-packages/atomicwrites/__init__.py", line 49, in _move_atomic
debug: os.link(src, dst)
I'm not sure if there is a proper solution for this or if this simply means vdirsyncer cannot be used on Android. If the latter is the case it would be nice if vdirsyncer could fail early and wouldn't try syncing every single item.
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 at vdirsyncer/storage/filesystem.py, especially upload and _upload_impl, and follow the atomicwrites commit path shown in the traceback. Reproduce the failure on Android/Termux if possible, then determine whether syncing can work without os.link or whether vdirsyncer should detect the limitation before processing items. Done means Android behavior is supported or the limitation produces one early, actionable failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100