Kozea / Kozea/RadicaleStorageByIndex

strptime() argument 1 must be str, not None

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

In case a request is done with the following content:
```










```
There is an exception:
```
Traceback (most recent call last):
File "/srv/radicale/env/lib/python3.5/site-packages/radicale/__init__.py", line 332, in __call__
status, headers, answers = self._handle_request(environ)
File "/srv/radicale/env/lib/python3.5/site-packages/radicale/__init__.py", line 505, in _handle_request
environ, base_prefix, path, user)
File "/srv/radicale/env/lib/python3.5/site-packages/radicale/__init__.py", line 982, in do_REPORT
base_prefix, path, xml_content, collection)
File "/srv/radicale/env/lib/python3.5/site-packages/radicale/xmlutils.py", line 1267, in report
multistatus):
File "/srv/radicale/env/lib/python3.5/site-packages/radicale/xmlutils.py", line 1241, in retrieve_items
yield from collection.get_all_filtered(filters)
File "/srv/radicale/env/src/radicale-storage-by-index/radicale_storage_by_index/__init__.py", line 216, in get_all_filtered
datetime.strptime(request['dtend'], "%Y%m%dT%H%M%SZ"))
TypeError: strptime() argument 1 must be str, not None
```

This is caused by line 196 which adds dtend to the request always in case there is a time range in the content.
But in the example request there is only a start and no end..

Easy fix is to ONLY add dtend to request if filter_.get("end") is not None

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in radicale_storage_by_index/__init__.py at get_all_filtered, especially the request handling around line 196 and the datetime parsing shown in the traceback. Reproduce the calendar-query request with a start but no end, then verify that the request completes without the None strptime error and that bounded ranges still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.