Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2022 05:15:26 GMT
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 0bd37e7de4d0 - main - www/py-django-timezone-field: Fix regression with newer pytz releases
Message-ID:  <202208190515.27J5FQkY020168@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0bd37e7de4d022d9540e1e239033c756cc671174

commit 0bd37e7de4d022d9540e1e239033c756cc671174
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2022-08-19 05:03:35 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2022-08-19 05:03:35 +0000

    www/py-django-timezone-field: Fix regression with newer pytz releases
    
    * Backport a PR which fixes the "ZoneInfoNotFoundError" exception when
      populating and comparing timezones against pytz which don't yet exist
      in zoneinfo.
    
    MFH:            2022Q3
---
 www/py-django-timezone-field/Makefile              |  2 +-
 .../files/patch-timezone__field_fields.py          | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/www/py-django-timezone-field/Makefile b/www/py-django-timezone-field/Makefile
index 450ed16fa1b6..27af50f30e22 100644
--- a/www/py-django-timezone-field/Makefile
+++ b/www/py-django-timezone-field/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	django-timezone-field
 DISTVERSION=	5.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/www/py-django-timezone-field/files/patch-timezone__field_fields.py b/www/py-django-timezone-field/files/patch-timezone__field_fields.py
new file mode 100644
index 000000000000..72b10b78da49
--- /dev/null
+++ b/www/py-django-timezone-field/files/patch-timezone__field_fields.py
@@ -0,0 +1,27 @@
+From 0257f2e9c7c488e8a859ee924c93d9f38afa4dc7 Mon Sep 17 00:00:00 2001
+From: jeremystretch <jstretch@ns1.com>
+Date: Fri, 12 Aug 2022 10:03:27 -0400
+Subject: [PATCH] Fixes #94: Catch ZoneInfoNotFoundError exception when
+ populating timezones
+
+Obtained from:
+
+https://github.com/mfogel/django-timezone-field/commit/0257f2e9c7c488e8a859ee924c93d9f38afa4dc7
+
+--- timezone_field/fields.py.orig	2022-02-09 04:42:10 UTC
++++ timezone_field/fields.py
+@@ -38,7 +38,13 @@ class TimeZoneField(models.Field):
+     #       existing migration files will need to be accomodated.
+     default_max_length = 63
+     default_pytz_tzs = [pytz.timezone(tz) for tz in pytz.common_timezones]
+-    default_zoneinfo_tzs = [ZoneInfo(tz) for tz in pytz.common_timezones]
++    default_zoneinfo_tzs = []
++    for tz in pytz.common_timezones:
++        try:
++            default_zoneinfo_tzs.append(ZoneInfo(tz))
++        except ZoneInfoNotFoundError:
++            # ZoneInfo does not yet exist for this timezone
++            pass
+ 
+     def __init__(self, *args, **kwargs):
+         # allow some use of positional args up until the args we customize



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208190515.27J5FQkY020168>