JSON with local time gives bad gateway error

If using JSON format and requesting local timestamps gives the following error:

What happened?
The web server reported a bad gateway error.

What can I do?
Please try again in a few minutes.

For example, modifying the example Python script with parameter local_time fails:

##
# Wind example
##

url = api_base + 'data/wind'

args = {
    'lat': 34.125,
    'lon': 39.814,
    'date_from': '2014-01-01',
    'date_to': '2014-12-31',
    'capacity': 1.0,
    'height': 100,
    'turbine': 'Vestas V80 2000',
    'format': 'json',
    'metadata': False,
    'local_time': True  # <----
}

r = s.get(url, params=args)

With csv format, local time is ok, and I get:

time,"(‘local_time’, ‘Asia/Damascus’)",output
2014-01-01 00:00,2014-01-01 02:00,0.151
2014-01-01 01:00,2014-01-01 03:00,0.153
2014-01-01 02:00,2014-01-01 04:00,0.147
2014-01-01 03:00,2014-01-01 05:00,0.126

Hi Erkka,

Thank you for flagging this up. I have copied the bug report over to our issues manager. I’ll get back to you when Stefan has looked at it (he’s the Python guy)…

Kind regards,
Iain