Skip to content
This repository has been archived by the owner on Aug 10, 2019. It is now read-only.

'str' object has no attribute read #9

Open
tbadams45 opened this issue Aug 25, 2015 · 1 comment
Open

'str' object has no attribute read #9

tbadams45 opened this issue Aug 25, 2015 · 1 comment

Comments

@tbadams45
Copy link

Attempted to run NextAction, had latest version of dateutil installed. Got "AttributeError: 'str' object has no attribute 'read'", root cause in the parser.py file from dateutil. Not really sure what to make of this, but would appreciate any help as it's preventing me from using your fantastic script.

Here's the error info I received:

INFO:root:Found next_action label, id: 766068
DEBUG:root:pushing "1 - Solar: Research yieldcos" on the parent stack beneath "1 - Solar: Research yieldcos"
DEBUG:root:adding item "Review Sun Edison reports Finny sent re: yieldcos" with parent "1 - Solar: Research yieldcos"
DEBUG:root:pushing "Ministry - Far" on the parent stack beneath "Ministry - Far"
DEBUG:root:adding item "Hit Kevin up - when's a time we can skype in the next 3 weeks?" with parent "Ministry - Far"
DEBUG:root:adding item "Call Jeff" with parent "Ministry - Far"
Traceback (most recent call last):
File "nextaction.py", line 375, in
main()
File "nextaction.py", line 357, in main
a = TodoistData(initial_data)
File "nextaction.py", line 212, in init
project.BuildItemTree()
File "nextaction.py", line 179, in BuildItemTree
item = Item(item_dict)
File "nextaction.py", line 58, in init
self.due_date_utc = p.parse(initial_data['due_date_utc'])
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 392, in parse
res = self._parse(timestr, **kwargs)
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 492, in _parse
l = _timelex.split(timestr) # Splits the timestr into tokens
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 174, in split
return list(cls(s))
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 171, in next
return self.next() # Python 2.x support
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 164, in next
token = self.get_token()
File "c:\Python27\lib\site-packages\dateutil\parser.py", line 82, in get_token
nextchar = self.instream.read(1)
AttributeError: 'str' object has no attribute 'read'

@stoduk
Copy link

stoduk commented Mar 23, 2016

Do you still see the problem? Looks like the dateutil parser is failing to handle the UTC time returned by Todoist. Quite possible this was a temporary issue that has now been fixed by them, but if you still see it then seeing the contents of that attribute should make it obvious what is wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants