ValueError with example code

Bug #1588196 reported by Hugo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
astral
Invalid
Undecided
Unassigned

Bug Description

Windows 7, Python 2.7.11, Astral

The example code at https://pythonhosted.org/astral/#example works in IDLE:

```
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> from astral import Astral
>>> city_name = 'London'
>>> a = Astral()
>>> a.solar_depression = 'civil'
>>> city = a[city_name]
>>> print('Information for %s/%s\n' % (city_name, city.region))
Information for London/England

>>> timezone = city.timezone
>>> print('Timezone: %s' % timezone)
Timezone: Europe/London
>>> print('Latitude: %.02f; Longitude: %.02f\n' % \
... (city.latitude, city.longitude))
Latitude: 51.50; Longitude: -0.12

>>> sun = city.sun(date=datetime.date(2009, 4, 22), local=True)
>>> print('Dawn: %s' % str(sun['dawn']))
Dawn: 2009-04-22 05:12:06+01:00

```

But when I

Revision history for this message
Hugo (hugovk) wrote :

Accidentally submitted that too early. I can't see a way to edit it, so please ignore and I'll resubmit.

Changed in astral:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.