[Django] #33279: time zone with dash in name not recognized

4 views
Skip to first unread message

Django

unread,
Nov 10, 2021, 1:47:51 PM11/10/21
to django-...@googlegroups.com
#33279: time zone with dash in name not recognized
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Maybe I do something wrong, but I ran into a problem:

{{{
In [1]: import zoneinfo

In [2]: import datetime

In [3]: with timezone.override(zoneinfo.ZoneInfo('Asia/Ust-Nera')):
...:
SomeModel.objects.filter(date__date=datetime.datetime.now().date()).only('id').first()
...:
SELECT "some_model"."id"
FROM "some_model"
WHERE ("some_model"."date" AT TIME ZONE 'Asia/Ust+Nera')::date =
'2021-11-10'::date
ORDER BY "some_model"."id" ASC
LIMIT 1

Execution time: 0.003478s [Database: default]
---------------------------------------------------------------------------
InvalidParameterValue Traceback (most recent call
last)
/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py in
_execute(self, sql, params, *ignored_wrapper_args)
83 else:
---> 84 return self.cursor.execute(sql, params)
85

InvalidParameterValue: time zone "Asia/Ust+Nera" not recognized

}}}

Timezone "Asia/Ust-Nera" supported by psql:


{{{
SELECT name FROM pg_timezone_names where name = 'Asia/Ust-Nera';
}}}


Reproduced on Postgresql 11 and 12

--
Ticket URL: <https://code.djangoproject.com/ticket/33279>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 10, 2021, 2:44:53 PM11/10/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.

-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Can Sarıgöl, Carlton Gibson (added)
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. Time zones with the minus in names are incorrectly
converted:
- to `-Nera` on MySQL and Oracle,
- to `Asia/Ust+Nera` on PostgreSQL,
- to `Asia/Ust` and `+Nera` offset on SQLite.

Regression in fde9b7d35e4e185903cc14aa587ca870037941b1.

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:1>

Django

unread,
Nov 11, 2021, 2:57:12 AM11/11/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned

Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Can Sarıgöl):

* owner: nobody => Can Sarıgöl
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:2>

Django

unread,
Nov 11, 2021, 4:40:57 AM11/11/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Can Sarıgöl):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/15078 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:3>

Django

unread,
Nov 11, 2021, 5:12:32 AM11/11/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:4>

Django

unread,
Nov 11, 2021, 6:00:24 AM11/11/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Can Sarıgöl):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:5>

Django

unread,
Nov 12, 2021, 1:38:17 AM11/12/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:6>

Django

unread,
Nov 12, 2021, 3:04:06 AM11/12/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: closed

Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"661316b066923493ff91d6d2aa92e463f595a6b1" 661316b0]:
{{{
#!CommitTicketReference repository=""
revision="661316b066923493ff91d6d2aa92e463f595a6b1"
Fixed #33279 -- Fixed handling time zones with "-" sign in names.

Thanks yakimka for the report.

Regression in fde9b7d35e4e185903cc14aa587ca870037941b1.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:7>

Django

unread,
Nov 12, 2021, 5:16:24 AM11/12/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d54aa49a7d15e708b7da1620310167f39e859cba" d54aa49a]:
{{{
#!CommitTicketReference repository=""
revision="d54aa49a7d15e708b7da1620310167f39e859cba"
[4.0.x] Fixed #33279 -- Fixed handling time zones with "-" sign in names.

Thanks yakimka for the report.

Regression in fde9b7d35e4e185903cc14aa587ca870037941b1.

Backport of 661316b066923493ff91d6d2aa92e463f595a6b1 from main.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:8>

Django

unread,
Dec 7, 2021, 7:21:50 AM12/7/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by yakimka):

This fix was not added to version 3.2.10 by mistake?

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:9>

Django

unread,
Dec 7, 2021, 7:27:21 AM12/7/21
to django-...@googlegroups.com
#33279: Time zones with minus in names are incorrectly converted.
-------------------------------------+-------------------------------------
Reporter: yakimka | Owner: Can
| Sarıgöl
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:9 yakimka]:


> This fix was not added to version 3.2.10 by mistake?

It's a regression in Django 3.0, per our backporting policy this means it
doesn't qualify for a backport to 3.2.x anymore. See
[https://docs.djangoproject.com/en/stable/internals/release-process/
Django’s release process] for more details.

--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:10>

Reply all
Reply to author
Forward
0 new messages