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

pytz shim tzinfo exceptions on serializing events when creating #1096

Closed
RonnyPfannschmidt opened this issue Oct 26, 2021 · 1 comment
Closed

Comments

@RonnyPfannschmidt
Copy link

i have a freshly configured khal with no calendar elements

when i run

$ khal new "07:00" "07:15" --repeat daily aufstehen          /home/ronny/Projects/RonnyPfannschmidt/khal/khal/icalendar.py:104: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  dtstart = timezone.localize(dtstart)
/home/ronny/Projects/RonnyPfannschmidt/khal/khal/icalendar.py:105: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  dtend = timezone.localize(dtend)
/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/icalendar/parser.py:54: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  if hasattr(dt.tzinfo, 'zone'):
/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/icalendar/parser.py:55: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  tzid = dt.tzinfo.zone  # pytz implementation
Traceback (most recent call last):
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/bin/khal", line 33, in <module>
    sys.exit(load_entry_point('khal', 'console_scripts', 'khal')())
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/cli.py", line 388, in new
    new_func(
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/controllers.py", line 355, in new_from_string
    new_from_args(
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/controllers.py", line 381, in new_from_args
    collection.new(event)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/khalendar/khalendar.py", line 208, in new
    event.href, event.etag = self._storages[calendar].upload(event)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/khalendar/vdir.py", line 212, in upload
    if not isinstance(item.raw, str):
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/khalendar/event.py", line 382, in raw
    timezone = create_timezone(tzinfo, self.start)
  File "/home/ronny/Projects/RonnyPfannschmidt/khal/khal/khalendar/event.py", line 858, in create_timezone
    for one, two in iter(tz._tzinfos.items())
AttributeError: '_PytzShimTimezone' object has no attribute '_tzinfos'

its possibly related to the api changes in pytz and i'll slowly investigate it

@RonnyPfannschmidt
Copy link
Author

closing as
Duplicate of #1092

eventually solved in #1093

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

No branches or pull requests

1 participant