plone / plone.app.event

Event content type for Plone
https://pypi.python.org/pypi/plone.app.event
Other
17 stars 37 forks source link

Don't error out on 'Africa/Abidjan' timezone [gyst] #394

Closed gyst closed 3 months ago

gyst commented 4 months ago

Fixes #393 by not using our own null datetime, which was equal but not identical to datetime.min.

The test provided throws an OverflowError without the patch provided.

mister-roboto commented 4 months ago

@gyst thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

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!

gyst commented 4 months ago

Please note that running tests locally gives two errors I also get when running tests against master.

gyst commented 4 months ago

@jenkins-plone-org please run jobs

davisagli commented 4 months ago

@gyst I tried this in a Plone site with the site timezone set to Africa/Abidjan. This change avoids the OverflowError, but I got a different error instead.

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 391, in publish_module
  Module ZPublisher.WSGIPublisher, line 285, in publish
  Module ZPublisher.mapply, line 98, in mapply
  Module ZPublisher.WSGIPublisher, line 68, in call_object
  Module plone.app.event.ical.exporter, line 407, in __call__
  Module plone.app.event.ical.exporter, line 403, in get_ical_string
  Module zope.component.hooks, line 144, in adapter_hook
  Module plone.app.event.ical.exporter, line 165, in calendar_from_event
  Module plone.app.event.ical.exporter, line 82, in construct_icalendar
  Module icalendar.cal, line 194, in add
  Module icalendar.cal, line 145, in _encode
  Module icalendar.prop, line 852, in __init__
ValueError: Offset value MUST be a timedelta instance
gyst commented 4 months ago

This fix is for an event with the timezone set to Africa/Abidjan. I did not think about setting the site timezone. This looks like potentially a separate (though similar) bug?

jensens commented 3 months ago

@jenkins-plone-org please run jobs

jensens commented 3 months ago

I think @davisagli found a different bug. I am fine to merge this one if all is green here and you create a new issue with above findings.