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

Problem parsing a file with event recurring on weekdays #165

Closed
dmedvinsky opened this issue Jul 13, 2015 · 8 comments · Fixed by #545
Closed

Problem parsing a file with event recurring on weekdays #165

dmedvinsky opened this issue Jul 13, 2015 · 8 comments · Fixed by #545

Comments

@dmedvinsky
Copy link

The offending file:

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft CDO for Microsoft Exchange
VERSION:2.0
BEGIN:VTIMEZONE
TZID:GMT +0100 (Standard) / GMT +0200 (Daylight)
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20150703T071009Z
DTSTART;TZID="GMT +0100 (Standard) / GMT +0200 (Daylight)":20150703T100000
SUMMARY:Sprint 25 Daily Standup
DTEND;TZID="GMT +0100 (Standard) / GMT +0200 (Daylight)":20150703T103000
RRULE:FREQ=DAILY;UNTIL=20150722T080000Z;INTERVAL=1;BYDAY=MO, TU, WE, TH, FR
 ;WKST=SU
END:VEVENT
END:VCALENDAR

Trying to parse it:

icalendar.Calendar.from_ical(content).subcomponents
[VTIMEZONE({u'TZID': vText('GMT +0100 (Standard) / GMT +0200 (Daylight)')}, STANDARD({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at 0x7fc886ece3d0>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at 0x7fc886ece450>, u'RRULE': vRecur({u'BYMONTH': [10], u'FREQ': [u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}), u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece390>}), DAYLIGHT({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at 0x7fc886ece510>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at 0x7fc886ece150>, u'RRULE': vRecur({u'BYMONTH': [3], u'FREQ': [u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}), u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece410>}))]

As you can see, there is only one component: VTIMEZONE. The VEVENT component is gone.

The offending line is:

RRULE:FREQ=DAILY;UNTIL=20150722T080000Z;INTERVAL=1;BYDAY=MO, TU, WE, TH, FR
 ;WKST=SU

In particular, it's the BYDAY=MO, TU, WE, TH, FR part. If I remove this part, everything is parsed as expected:

icalendar.Calendar.from_ical(content).subcomponents
[VTIMEZONE({u'TZID': vText('GMT +0100 (Standard) / GMT +0200 (Daylight)')}, STANDARD({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at 0x7fc886ece450>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at 0x7fc886ece390>, u'RRULE': vRecur({u'BYMONTH': [10], u'FREQ': [u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}), u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc88c1dda50>}), DAYLIGHT({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at 0x7fc886ece150>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at 0x7fc886ece410>, u'RRULE': vRecur({u'BYMONTH': [3], u'FREQ': [u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}), u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece510>})), VEVENT({u'DTSTAMP': <icalendar.prop.vDDDTypes object at 0x7fc886ece190>, u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece1d0>, u'RRULE': vRecur({u'FREQ': [u'DAILY'], u'INTERVAL': [1], u'UNTIL': [datetime.datetime(2015, 7, 22, 8, 0, tzinfo=<UTC>)], u'WKST': [u'SU']}), u'DTEND': <icalendar.prop.vDDDTypes object at 0x7fc886ece250>, u'SUMMARY': vText('Sprint 25 Daily Standup')})]
@geier
Copy link
Collaborator

geier commented Jul 13, 2015

If I read the RFC correctly, those blanks are invalid. Could you try with removed blanks?

Am 13. Juli 2015 10:26:47 MESZ, schrieb Dmitry Medvinsky notifications@github.com:

The offending file:

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft CDO for Microsoft Exchange
VERSION:2.0
BEGIN:VTIMEZONE
TZID:GMT +0100 (Standard) / GMT +0200 (Daylight)
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20150703T071009Z
DTSTART;TZID="GMT +0100 (Standard) / GMT +0200
(Daylight)":20150703T100000
SUMMARY:Sprint 25 Daily Standup
DTEND;TZID="GMT +0100 (Standard) / GMT +0200
(Daylight)":20150703T103000
RRULE:FREQ=DAILY;UNTIL=20150722T080000Z;INTERVAL=1;BYDAY=MO, TU, WE,
TH, FR
;WKST=SU
END:VEVENT
END:VCALENDAR

Trying to parse it:

icalendar.Calendar.from_ical(content).subcomponents
[VTIMEZONE({u'TZID': vText('GMT +0100 (Standard) / GMT +0200
(Daylight)')}, STANDARD({u'TZOFFSETTO': <icalendar.prop.vUTCOffset
object at 0x7fc886ece3d0>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset
object at 0x7fc886ece450>, u'RRULE': vRecur({u'BYMONTH': [10], u'FREQ':
[u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}),
u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece390>}),
DAYLIGHT({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at
0x7fc886ece510>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at
0x7fc886ece150>, u'RRULE': vRecur({u'BYMONTH': [3], u'FREQ':
[u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}),
u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece410>}))]

As you can see, there is only one component: VTIMEZONE. The VEVENT
component is gone.

The offending line is:

RRULE:FREQ=DAILY;UNTIL=20150722T080000Z;INTERVAL=1;BYDAY=MO, TU, WE,
TH, FR
;WKST=SU

In particular, it's the BYDAY=MO, TU, WE, TH, FR part. If I remove
this part, everything is parsed as expected:

icalendar.Calendar.from_ical(content).subcomponents
[VTIMEZONE({u'TZID': vText('GMT +0100 (Standard) / GMT +0200
(Daylight)')}, STANDARD({u'TZOFFSETTO': <icalendar.prop.vUTCOffset
object at 0x7fc886ece450>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset
object at 0x7fc886ece390>, u'RRULE': vRecur({u'BYMONTH': [10], u'FREQ':
[u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}),
u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc88c1dda50>}),
DAYLIGHT({u'TZOFFSETTO': <icalendar.prop.vUTCOffset object at
0x7fc886ece150>, u'TZOFFSETFROM': <icalendar.prop.vUTCOffset object at
0x7fc886ece410>, u'RRULE': vRecur({u'BYMONTH': [3], u'FREQ':
[u'YEARLY'], u'WKST': [u'MO'], u'INTERVAL': [1], u'BYDAY': [u'-1SU']}),
u'DTSTART': <icalendar.prop.vDDDTypes object at 0x7fc886ece510>})),
VEVENT({u'DTSTAMP': <icalendar.prop.vDDDTypes object at
0x7fc886ece190>, u'DTSTART': <icalendar.prop.vDDDTypes object at
0x7fc886ece1d0>, u'RRULE': vRecur({u'FREQ': [u'DAILY'], u'INTERVAL':
[1], u'UNTIL': [datetime.datetime(2015, 7, 22, 8, 0, tzi
nfo=<UTC
>)], u'WKST': [u'SU']}), u'DTEND': <icalendar.prop.vDDDTypes object at
0x7fc886ece250>, u'SUMMARY': vText('Sprint 25 Daily Standup')})]

Reply to this email directly or view it on GitHub:
#165

@dmedvinsky
Copy link
Author

Yeah, it works if I remove the spaces after commas. I'll try to ask the person who sent me this file how did they obtain it. Does the icalendar follow RFC strictly and I should close this issue, or do you include some workarounds if this is, say, a bug in MS Exchange you want to deal with?

@thet
Copy link
Member

thet commented Jul 13, 2015

The information about the source of the ical file would really be interesting. If it's from a widely spread source, we should think about including a workaround.

@dmedvinsky
Copy link
Author

OK, I'm awaiting the reply from the original file author.

@geier
Copy link
Collaborator

geier commented Jul 14, 2015

The PRODID says this is was created by "Microsoft CDO for Microsoft Exchange", does anyone have access to a Microsoft Exchange Server/Client and can try to reproduce this error?

@dmedvinsky
Copy link
Author

Well, I just tried it with MS Exchange 13 using its web interface and the generated event didn't have those spaces in the BYDAY property.

The original author haven't gotten back to me with the info about the origin of the file though.

@dmedvinsky
Copy link
Author

The original author contacted me with the following email:

I tried to reproduce the error with Outlook 2010 and what appears to be
a Exchange Server 2007 (if we can trust the prodid of the subscription)
And I'm not able to reproduce the issue. I asked my co worker who send
me the broken invitation to confirm that he created it with outlook. He
just answered:

He has two methods, both seem to produce the broken file:

  • If the webex integration plugin for outlook works, than he uses that.
  • If the webex integration plugin for outlook does not work, he creates
    in firefox on the webex webpage the meetings, receives the e-mail and
    copies the content.

So WebEx seems to be the culprit. I just checked and every single
invitation for a daily sprint that I received from him in the last year,
contains the error.

@dmedvinsky
Copy link
Author

Another one:

I tried to reproduce the issue with the webex webinterface, but was
unable to. The event that I created has a correct format:

RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;UNTIL=20150730T173500Z

So it has to be something else. Also for me when I create the meeting
using the webinterface I get:

PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN

Even if it was not created using Outlook but using the Webex Web
Interface.

niccokunzmann added a commit to niccokunzmann/icalendar that referenced this issue Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants