-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Fix #355 url escaping #356
base: main
Are you sure you want to change the base?
Conversation
@NicoHood thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
@jenkins-plone-org please run jobs |
@NicoHood, we are in the process of setting up maintenance for this repository again, see #360. It will take some time but I hope, we will get further towards integrating your changes. Thanks a lot for the effort and patience already! |
@NicoHood, I am starting to get ready for this one - I am a maintainer here now just because I wanted to help you a bit but it is nice to work on this one here, too! So, the tests are running for the branches and if you were to rebase/merge, you can see that. Also, I am hesitant to merge what is not tests as it may break in the future. There is something that we can add as tests - you have a lot of data - would you like to add that? |
I just generated a quick test ics file BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ical.marudot.com//iCal Event Maker
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20220822T164528Z
UID:[email protected]
DTSTART;TZID=Europe/Berlin:20220822T120000
DTEND;TZID=Europe/Berlin:20220822T120000
SUMMARY:test
DESCRIPTION:https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D
END:VEVENT
END:VCALENDAR I guess you just need to validate if the description is parsed as:
I hope this helps. I am sorry that I aint got time to write tests myself. Thanks a lot for taking over that important part :) |
@NicoHood Created NicoHood#1 to your PR to add a test |
I rebased my branch and cherry-picked your test commit. Is it fine now? |
The tests are not running, so I will not merge it for now. |
I created PR #426 and the tests are running - I would like to have tests failing so we can make sure that code changes are needed - do you have more examples of failed unescaping? The one in the comment is not failing. |
It is not failing? That sounds weird. |
So I dont know what your tests are doing, but I created my own "test": test.ical BEGIN:VEVENT
DTSTAMP:20220822T164528Z
UID:[email protected]
DTSTART;TZID=Europe/Berlin:20220822T120000
DTEND;TZID=Europe/Berlin:20220822T120000
SUMMARY:test
DESCRIPTION:https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D
END:VEVENT icaltest.py: #!/usr/bin/env python3
import icalendar
with open('test.ical') as f:
ical_text = f.read()
print(ical_text)
print('---')
ical = icalendar.Calendar.from_ical(ical_text)
print(ical['DESCRIPTION'])
expected_result = 'https://www.facebook.com/events/756119502186737/?acontext=%7B%22source%22%3A5%2C%22action_history%22%3A[%7B%22surface%22%3A%22page%22%2C%22mechanism%22%3A%22main_list%22%2C%22extra_data%22%3A%22%5C%22[]%5C%22%22%7D]%2C%22has_source%22%3Atrue%7D'
print(ical['DESCRIPTION'] == expected_result) Output
I am using python-icalendar |
Can you test it with the master branch? I will add another test.
|
@niccokunzmann
See #355
Note: I have not tested this inside the library itself, only via monkey patch. But this should result in the same code. Maybe someone can write a test for that?