Changes between Initial Version and Version 1 of Ticket #27544


Ignore:
Timestamp:
11/28/2016 11:28:13 AM (4 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27544

    • Property Component changed from Uncategorized to Database layer (models, ORM)
  • Ticket #27544 – Description

    initial v1  
    11Upon upgrading from 1.8 -> 1.10, I noticed that some code I had written now threw an error.  Specifically, attempting to update datetime field's via F expression.
    2 
    3 Bisect log, about 3000 commits back -> https://dpaste.de/HGYb
    42
    53Branch with test showing regression -> https://github.com/tadgh/django/commit/c31133261c68b10525b8e3b34e6895a0c6ece4d0
    64
    7 Apparent first commit where regression occurs -> https://github.com/django/django/pull/4601/commits/ed83881e648771d22658f21b939f66e75c499864
     5Bisected to ed83881e648771d22658f21b939f66e75c499864: Fixed #23820 -- Supported per-database time zone.
    86
    9 Stacktrace from failure -> https://dpaste.de/DkSV
     7Stacktrace from failure:
     8{{{
     9======================================================================
     10ERROR: test_F_expression_fails (timezones.test_regression.ProveRegression)
     11----------------------------------------------------------------------
     12Traceback (most recent call last):
     13  File "/home/tadgh/Projects/django/tests/timezones/test_regression.py", line 22, in test_F_expression_fails
     14    self.timestamp.refresh_from_db()
     15  File "/home/tadgh/Projects/django/django/db/models/base.py", line 585, in refresh_from_db
     16    db_instance = db_instance_qs.get()
     17  File "/home/tadgh/Projects/django/django/db/models/query.py", line 381, in get
     18    num = len(clone)
     19  File "/home/tadgh/Projects/django/django/db/models/query.py", line 240, in __len__
     20    self._fetch_all()
     21  File "/home/tadgh/Projects/django/django/db/models/query.py", line 1061, in _fetch_all
     22    self._result_cache = list(self.iterator())
     23  File "/home/tadgh/Projects/django/django/db/models/query.py", line 68, in __iter__
     24    for row in compiler.results_iter(results):
     25  File "/home/tadgh/Projects/django/django/db/models/sql/compiler.py", line 806, in results_iter
     26    row = self.apply_converters(row, converters)
     27  File "/home/tadgh/Projects/django/django/db/models/sql/compiler.py", line 790, in apply_converters
     28    value = converter(value, expression, self.connection, self.query.context)
     29  File "/home/tadgh/Projects/django/django/db/backends/sqlite3/operations.py", line 159, in convert_datetimefield_value
     30    value = timezone.make_aware(value, self.connection.timezone)
     31  File "/home/tadgh/Projects/django/django/utils/timezone.py", line 364, in make_aware
     32    return timezone.localize(value, is_dst=is_dst)
     33  File "/home/tadgh/.venvs/django_env/lib/python3.4/site-packages/pytz/__init__.py", line 227, in localize
     34    raise ValueError('Not naive datetime (tzinfo is already set)')
     35ValueError: Not naive datetime (tzinfo is already set)
     36}}}
Back to Top