# Friday, December 15, 2017¶

## AmbiguousTimeError¶

Yesterday Tonis and I had a surprise during an otherwise routine upgrade on Jane. We called it #2204.

Today we found out how to reproduce the problem and eliminate its cause. Thanks to Ilian Iliev for publishing his blog post Django, pytz, NonExistentTimeError and AmbiguousTimeError.

When somebody living in Brussels tells you “it was at on 2017-10-29 at 01:16:06”, then you don’t know whether they mean summer or winter time. Because their clock showed that time exactly twice during that night. The timestamp “2017-10-29 01:16:06” is ambigous.

The reason for #2204 was that dump2py used the site’s default TIME_ZONE setting when writing the naive values of DateTimeFields in the generated applabel_modelname.py files. When trying to load a dump which contains such a timstamp, Lino would cause an AmbiguousTimeError.

So dump2py must make sure to express the naive time literals in a timezone which doesn’t have such ambigous hours. UTC for example.

I extended Python dumps by example so that it now verifies whether #2204 is fixed. En passant this page now also demonstrates three methods of writing demo multilingual data for babel fields.

I added Facebook as a third authentication backend to the lino_book.projects.team demo project and updated the Social Authentication page.