Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 808795

Summary: app-misc/khal-0.10.2-r2 breaks with dev-python/tzlocal-3.0
Product: Gentoo Linux Reporter: Nils Freydank <holgersson>
Component: Current packagesAssignee: Amy Liffey <amynka>
Status: RESOLVED FIXED    
Severity: normal CC: marcel.schilling, mgorny, sam, yamadharma
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/pimutils/khal/issues/985
Whiteboard:
Package list:
Runtime testing required: ---

Description Nils Freydank 2021-08-17 20:54:34 UTC
Hi,

as noted earlier this week on IRC in #gentoo-python khal breaks with tzlocal-3.0
as tzlocal upstream has replaced pytz with zoneinfo[1].

The problem is known upstream[2] and mgorny already converted the dependency in
commit b29a9a34b2e614d3affecb971d66df81e3705858 [3].

I'm still writing this bug report to track upstream's migration progress or
possibly for to block a future tzlocal-3.0 tracker bug.

This bug is not fixed in khal-0.10.4, which I bumped locally before searching
in upstream's issues.

Here is the full trace from khal 0.10.0-r2::gentoo:
--- begin of trace
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/ikhal", line 33, in <module>
    sys.exit(load_entry_point('khal==0.10.2', 'console_scripts', 'ikhal')())
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/khal/cli.py", line 479, in interactive_cli
    controllers.interactive(
  File "/usr/lib/python3.9/site-packages/khal/controllers.py", line 542, in interactive
    pane = ui.ClassicView(
  File "/usr/lib/python3.9/site-packages/khal/ui/__init__.py", line 1037, in __init__
    daywalker = Walker(
  File "/usr/lib/python3.9/site-packages/khal/ui/__init__.py", line 358, in __init__
    self.ensure_date(this_date)
  File "/usr/lib/python3.9/site-packages/khal/ui/__init__.py", line 367, in ensure_date
    pile = self._get_events(day)
  File "/usr/lib/python3.9/site-packages/khal/ui/__init__.py", line 477, in _get_events
    self.events = sorted(self._collection.get_events_on(day))
  File "/usr/lib/python3.9/site-packages/khal/khalendar/khalendar.py", line 151, in get_events_on
    localize = self._locale['local_timezone'].localize
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
--- end of trace

[1] https://github.com/regebro/tzlocal/pull/92
[2] https://github.com/pimutils/khal/issues/985
[3] https://gitweb.gentoo.org/repo/gentoo.git/commit/app-misc/khal?id=b29a9a34b2e614d3affecb971d66df81e3705858

Reproducible: Always
Comment 1 Marcel Schilling 2021-09-28 06:03:02 UTC
I hit this issue as well.
Note that 0.10.2-r1 is the latest version available to me, so mgorny's fix is not kicking in (yet). I had to manually add `>=dev-python/tzlocal-3.0` to `/etc/portage/package.mask` followed by `emerge -1 dev-python/tzlocal` to get khal working again.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-29 16:08:30 UTC
(In reply to Marcel Schilling from comment #1)
> I hit this issue as well.
> Note that 0.10.2-r1 is the latest version available to me, so mgorny's fix
> is not kicking in (yet). I had to manually add `>=dev-python/tzlocal-3.0` to
> `/etc/portage/package.mask` followed by `emerge -1 dev-python/tzlocal` to
> get khal working again.

Wait.. what? Why can't you have a newer version?
Comment 3 Marcel Schilling 2021-10-30 14:44:01 UTC
Sorry, my bad:

I had

```
=app-misc/khal-0.10.2-r1 ~amd64
```

in `/etc/portage/package.accept_keywords`.
With `app-misc/khal-0.10.2-r2` there is no need to manually mask `>=app-misc/khal-0.10.2-r1` anymore as it indeed depends on `<dev-python/tzlocal-3` already.
Comment 4 Marcel Schilling 2021-10-30 14:47:52 UTC
s:>=app-misc/khal-0.10.2-r1:>=dev-python/tzlocal-3.0: ;-)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-31 04:46:56 UTC
Heh, great! Thanks for the update :)
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-05-06 13:44:16 UTC
Well, apparently tzlocal-4.0 works again.  It throws deprecation warnings but I suppose that's good enough to relax the dep and make it possible to upgrade tzlocal again.
Comment 7 Larry the Git Cow gentoo-dev 2022-05-06 13:46:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bde108e971b949d03c438f07880287fb28525704

commit bde108e971b949d03c438f07880287fb28525704
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2022-05-06 13:45:31 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2022-05-06 13:45:31 +0000

    app-misc/khal: Relax the dev-python/tzlocal dep again
    
    The breaking change from tzlocal-3 has been reverted in tzlocal-4,
    and khal now works again -- except for throwing a deprecation warning.
    I suppose that's good again to relax the dep and make tzlocal upgrade
    possible again.
    
    Closes: https://bugs.gentoo.org/808795
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 app-misc/khal/{khal-0.10.4.ebuild => khal-0.10.4-r1.ebuild} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)