Package: khal
Version: 1:0.10.4~ds-3
Severity: normal
X-Debbugs-Cc: eingousef+debb...@rhizogen.es.eu.org

Dear Maintainer,

Here's what happens when I try to create an event without specifying the TZ :

```
$ khal new -a private_calendar_local '2022-09-15 12:00' "test" :: "test"        
  
/usr/lib/python3/dist-packages/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)
/usr/lib/python3/dist-packages/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)
/usr/lib/python3/dist-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'):
/usr/lib/python3/dist-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 "/usr/bin/khal", line 5, in <module>
    main_khal()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in 
new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/khal/cli.py", line 388, in new
    new_func(
  File "/usr/lib/python3/dist-packages/khal/controllers.py", line 355, in 
new_from_string
    new_from_args(
  File "/usr/lib/python3/dist-packages/khal/controllers.py", line 381, in 
new_from_args
    collection.new(event)
  File "/usr/lib/python3/dist-packages/khal/khalendar/khalendar.py", line 208, 
in new
    event.href, event.etag = self._storages[calendar].upload(event)
  File "/usr/lib/python3/dist-packages/khal/khalendar/vdir.py", line 212, in 
upload
    if not isinstance(item.raw, str):
  File "/usr/lib/python3/dist-packages/khal/khalendar/event.py", line 382, in 
raw
    timezone = create_timezone(tzinfo, self.start)
  File "/usr/lib/python3/dist-packages/khal/khalendar/event.py", line 858, in 
create_timezone
    for one, two in iter(tz._tzinfos.items())
AttributeError: '_PytzShimTimezone' object has no attribute '_tzinfos'
```

Instead I have to do :

```
$ khal new -a private_calendar_local '2022-09-15 12:00 Europe/Paris' "test" :: 
"test"
```

Please bring the old behavior back, where khal used the system TZ when
no TZ was given.

Regards,

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (990, 'testing'), (980, 'stable-updates'), (980, 'stable'), (500, 
'stable-security'), (500, 'oldstable-updates'), (500, 'oldoldstable'), (500, 
'oldstable'), (90, 'experimental'), (90, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.19.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: OpenRC (via /run/openrc), PID 1: init
LSM: AppArmor: enabled

Versions of packages khal depends on:
ii  python3                3.10.6-1
ii  python3-atomicwrites   1.4.0-2
ii  python3-click          8.0.3-1
ii  python3-click-log      0.3.2-1
ii  python3-configobj      5.0.6-5
ii  python3-dateutil       2.8.1-6
ii  python3-icalendar      4.0.3-5
ii  python3-pkg-resources  59.6.0-1.2
ii  python3-tz             2022.2.1-1
ii  python3-tzlocal        4.2-1
ii  python3-urwid          2.1.2-2+b2
ii  python3-xdg            0.27-2

Versions of packages khal recommends:
ii  python3-setproctitle  1.3.1-1

Versions of packages khal suggests:
ii  khal-doc  1:0.10.4~ds-3

-- no debconf information

Reply via email to