Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2018-12-26 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  Aymeric
 Type:   |  Augustin
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by CHI Cheng):

 PyYaml's (still open) pull request:
 https://github.com/yaml/pyyaml/pull/113

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.849157fba82cd1fc53e9603cd48ab0f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2018-02-28 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  Aymeric
 Type:   |  Augustin
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 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 tehfink):

 * cc: tehfink (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.bca398546362d75b834df26eea141ab3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2016-04-12 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 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 Feuermurmel):

 * cc: michi.schwarz@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.1d4af406c56e4a809e1e0c95cdd76d8f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2016-04-12 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Feuermurmel):

 Replying to [comment:5 dcreager]:
 > 1. Don't use the `!!timestamp` YAML tag

 Is there a way to prevent `./manage.py dumpdata --format yaml` from
 automatically inserting the `!!timestamp` tags? We mainly run into this
 problem when using that command to generate fixtures for our unit tests.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.67fa25452cedf5b9078d9c308c806aa7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2014-09-04 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  1.4
Component:  Database layer   |   Resolution:  invalid
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by dcreager):

 I've found a workaround that I can't find documented anywhere else, so I'm
 posting it here for the record.

 The key is to force PyYAML to interpret the timestamp values as strings,
 and not let it perform the conversion to a `datetime`.  PyYAML will then
 pass the bare string value on to Django, which will correctly parse a
 timezone-aware `datetime`.

 For this to work you must make sure that all of the following are true:

 1. Don't use the `!!timestamp` YAML tag
 2. Enclose the timestamp values in quotes (which bypasses PyYAML's logic
 for automatically detecting a value's type based on what it looks like)
 3. Include timezone information in the timestamp value

 When we do all three of these steps with our fixture data, we don't see
 any naive datetime warnings.  Note that this doesn't help any with #21578,
 since the data dumper produces YAML content that doesn't follow all three
 of these rules.  We've had to resort to a manual post-processing step to
 massage the timestamp values.  Not ideal, but it works.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/076.8f5273aa7025374eaba70ad7ceef3ca1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2012-09-07 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  1.4
Component:  Database layer   |   Resolution:  invalid
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => invalid


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2012-08-29 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  1.4
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * component:  Documentation => Database layer (models, ORM)


Comment:

 Russell, what's your recommendation at this point? Just keep the ticket
 open until PyYAML gets fixed?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2012-08-28 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  1.4
Component:  Documentation|   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Old description:

> Loading a YAML fixture with a timezone aware DateTimeField in Django 1.4
> will cause the following warning even if the field is defined with
> timezone information in the YAML file
>
> django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField
> received a naive datetime (2012-08-27 13:01:56.784734) while time zone
> support is active.
>
> Excerpt from testdata.yaml
>
> [...] , insert_date: !!timestamp '2012-08-27 13:01:56.784734+00:00',
> [...]
>
> The test data is loaded by adding "fixtures = ['testdata']" at the start
> of a test case class.
>
> This bug is mentioned in Django test suite -
> django/trunk/tests/modeltests/timezones/tests.py:SerializationTests
>
> Note: the trick of "MyTests = override_settings(USE_TZ=False)(MyTests)"
> (from #17940) often does not work as expected, because you can then get
> "ValueError: SQLite backend does not support timezone-aware datetimes
> when USE_TZ is False" during fixture loading

New description:

 Loading a YAML fixture with a timezone aware DateTimeField in Django 1.4
 will cause the following warning even if the field is defined with
 timezone information in the YAML file
 {{{
 django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField
 received a naive datetime (2012-08-27 13:01:56.784734) while time zone
 support is active.
 }}}
 Excerpt from testdata.yaml
 {{{
 [...] , insert_date: !!timestamp '2012-08-27 13:01:56.784734+00:00', [...]
 }}}
 The test data is loaded by adding "fixtures = ['testdata']" at the start
 of a test case class.

 This bug is mentioned in Django test suite -
 django/trunk/tests/modeltests/timezones/tests.py:SerializationTests

 Note: the trick of "MyTests = override_settings(USE_TZ=False)(MyTests)"
 (from #17940) often does not work as expected, because you can then get
 "ValueError: SQLite backend does not support timezone-aware datetimes when
 USE_TZ is False" during fixture loading

--

Comment (by russellm):

 Historically, we haven't modified Django's docs to point out problems in
 downstream libraries -- the reasoning being that if the bug is fixed,
 there's never an action to correct Django's documentation and remove the
 warning. We've usually relied on the ticket tracker making it easy to find
 such problems.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2012-08-28 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
-+-
 Reporter:  aigarius@…   |Owner:  aaugustin
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  1.4
Component:  Documentation|   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * component:  Database layer (models, ORM) => Documentation
 * needs_tests:   => 0
 * owner:  nobody => aaugustin
 * needs_docs:   => 0
 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Indeed, this is [http://pyyaml.org/ticket/202 a bug in PyYAML], as
 
[https://github.com/django/django/blob/master/tests/modeltests/timezones/tests.py#L490
 described in this comment].

 There hasn't been any activity whatsoever on PyYAML's tracker, besides the
 creation of new tickets, since over one year. The project looks abandoned.

 We aren't going to removing support for YAML fixtures now just because of
 this bug in PyYAML. We can document this as a known problem
 [https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#fixtures
 here] and tell people to use JSON fixtures.

 Other ideas?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #18867: Restoring YAML fixtures with DateTimeField causes timezone warnings

2012-08-28 Thread Django
#18867: Restoring YAML fixtures with DateTimeField causes timezone warnings
--+
 Reporter:  aigarius@…|  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  Database layer (models, ORM)  |Version:  1.4
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Loading a YAML fixture with a timezone aware DateTimeField in Django 1.4
 will cause the following warning even if the field is defined with
 timezone information in the YAML file

 django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField
 received a naive datetime (2012-08-27 13:01:56.784734) while time zone
 support is active.

 Excerpt from testdata.yaml

 [...] , insert_date: !!timestamp '2012-08-27 13:01:56.784734+00:00', [...]

 The test data is loaded by adding "fixtures = ['testdata']" at the start
 of a test case class.

 This bug is mentioned in Django test suite -
 django/trunk/tests/modeltests/timezones/tests.py:SerializationTests

 Note: the trick of "MyTests = override_settings(USE_TZ=False)(MyTests)"
 (from #17940) often does not work as expected, because you can then get
 "ValueError: SQLite backend does not support timezone-aware datetimes when
 USE_TZ is False" during fixture loading

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.