pld/bamboo — pull request #22 by ukanga (2012-09-13 11:06:30+00:00)
Title: Attribute error float nan value

The exception below occurs when a field or cell in the second row is blank, which is usually represented as a float('nan') and hence causes the exception on dateutil.parse. This commits resolves that.

```python
Traceback (most recent call last):
File "/home/ukanga/dev/bamboo/bamboo/tests/controllers/test_datasets.py", line 163, in test_POST_file_for_nan_float_cell
result = json.loads(self.controller.POST(csv_file=mock_uploaded_file))
File "/home/ukanga/dev/bamboo/bamboo/controllers/datasets.py", line 93, in POST
result = create_dataset_from_csv(csv_file)
File "/home/ukanga/dev/bamboo/bamboo/lib/io.py", line 70, in create_dataset_from_csv
import_dataset(tmpfile.name, dataset)
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/celery/app/task.py", line 315, in __call__
return self.run(*args, **kwargs)
File "/home/ukanga/dev/bamboo/bamboo/lib/tasks/import_dataset.py", line 15, in import_dataset
dframe = recognize_dates(read_csv(_file))
File "/home/ukanga/dev/bamboo/bamboo/lib/utils.py", line 81, in recognize_dates
date_parse(dframe[column][0])
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 697, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 301, in parse
res = self._parse(timestr, **kwargs)
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 349, in _parse
l = _timelex.split(timestr)
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 143, in split
return list(cls(s))
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 137, in next
token = self.get_token()
File "/home/ukanga/Envs/bamboo/local/lib/python2.7/site-packages/dateutil/parser.py", line 68, in get_token
nextchar = self.instream.read(1)
AttributeError: 'float' object has no attribute 'read'
```