{{{
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.
* 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>
* owner: nobody => Can Sarıgöl
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/15078 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:3>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:4>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33279#comment:6>
* 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>
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>
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>
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>