Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local To-do 2.0 DTSTAMP issues #115906

Closed
alpharesearch opened this issue Apr 21, 2024 · 5 comments · Fixed by #115907
Closed

Local To-do 2.0 DTSTAMP issues #115906

alpharesearch opened this issue Apr 21, 2024 · 5 comments · Fixed by #115907

Comments

@alpharesearch
Copy link

The problem

I export a few local to-do lists from HA to a different VM, I copy the files from the .storage dir via ssh. It looks like the ICS format on HA between V1.0 and V2.0 has changed significantly. The new V2.0 ICS file crashes the ics python library. The ICS file is any without any items in the to-do list. I don't know the ICS file format and I'm not sure what DTSTAMP is used for, in my shopping list I only care for items, I don't use time. I did see some older bugs with tz issues. I'm not sure if what I'm seeing is a bug on HA side or the other library, but the output from HA is the cause of the issue. But I did also create a bug for ics lib ics-py/ics-py#415
Btw, when I switch back to a backup of the old file format as a test it works. All my code executes on this different VM.

Traceback (most recent call last):
File "/root/./hassio/homeassistant/python_scripts/sh_l2.py", line 45, in
c = Calendar(f.read())
File "/usr/local/lib/python3.10/dist-packages/ics/icalendar.py", line 69, in init
self._populate(containers[0]) # Use first calendar
File "/usr/local/lib/python3.10/dist-packages/ics/component.py", line 59, in _populate
parser(self, lines) # Send a list or empty list
File "/usr/local/lib/python3.10/dist-packages/ics/parsers/icalendar_parser.py", line 59, in parse_vtimezone
timezones = tzical(fake_file) # tzical does not like strings
File "/usr/local/lib/python3.10/dist-packages/dateutil/tz/tz.py", line 1279, in init
self._parse_rfc(fobj.read())
File "/usr/local/lib/python3.10/dist-packages/dateutil/tz/tz.py", line 1449, in _parse_rfc
raise ValueError("unsupported property: "+name)
ValueError: unsupported property: DTSTAMP

Here is the code, nothing special
44 f = open("/root/hassio/homeassistant/sam_s_shopping_list.ics", "r")
45 c = Calendar(f.read())
46 f.close()

new and not working sam_s_shopping_list.ics
BEGIN:VCALENDAR
PRODID:-//homeassistant.io//local_todo 2.0//EN
VERSION:2.0
BEGIN:VTIMEZONE
DTSTAMP:20240421T012017
TZID:America/New_York
BEGIN:STANDARD
DTSTART:20101107T020000
TZOFFSETTO:-0500
TZOFFSETFROM:-0400
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20100314T020000
TZOFFSETTO:-0400
TZOFFSETFROM:-0500
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE
END:VCALENDAR

old and working sam_s_shopping_list.ics
BEGIN:VCALENDAR
PRODID:-//homeassistant.io//local_todo 1.0//EN
VERSION:2.0
END:VCALENDAR

I updated everything I could think about:
Package Version
annotated-types 0.6.0
arrow 1.3.0
attrs 23.1.0
command-not-found 0.3
dbus-python 1.2.18
distro-info 1.1+ubuntu0.2
ical 7.0.3
ics 0.7.2
netifaces 0.11.0
pip 22.0.2
pydantic 2.7.0
pydantic_core 2.18.1
PyGObject 3.42.1
pyparsing 3.1.2
python-apt 2.4.0+ubuntu3
python-dateutil 2.8.2
PyYAML 5.4.1
setuptools 59.6.0
six 1.16.0
TatSu 5.8.3
types-python-dateutil 2.8.19.14
typing_extensions 4.11.0
tzdata 2024.1
ubuntu-pro-client 8001
ufw 0.36.1
wheel 0.37.1

What version of Home Assistant Core has the issue?

core-2024.4.3

What was the last working version of Home Assistant Core?

was working last month

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Local To-do

Link to integration documentation on our website

https://www.home-assistant.io/integrations/local_todo

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (local_todo) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of local_todo can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign local_todo Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


local_todo documentation
local_todo source
(message by IssueLinks)

@allenporter
Copy link
Contributor

allenporter commented Apr 21, 2024

Hi, this isn't a bug in home assistant. DTSTAMP is part of the rfc5545.

Edit: see correction below.

@allenporter allenporter closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
@allenporter allenporter reopened this Apr 21, 2024
@allenporter
Copy link
Contributor

Actually I see it's in VTIMEZONE which doesn't list that, so that could be omitted to be friendlier.

1 similar comment
@allenporter
Copy link
Contributor

Actually I see it's in VTIMEZONE which doesn't list that, so that could be omitted to be friendlier.

@allenporter allenporter mentioned this issue Apr 21, 2024
20 tasks
@alpharesearch
Copy link
Author

Thanks for double checking. I noticed that you maintain both projects yesterday too.
When I made the changes to my code in December to read todo list in addition to the shopping list, I looked at your library too, I don't use python that often and the other library had more examples. With that I was able to implement what I needed pretty much with just copy and paste.

@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants