Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first attempt at exporting bugs thwarted with AttributeError #1

Open
ghost opened this issue Mar 6, 2012 · 1 comment
Open

first attempt at exporting bugs thwarted with AttributeError #1

ghost opened this issue Mar 6, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 6, 2012

[rejon@slowtop:~/Software/lp2gh]
$ bin/lp2gh-export-bugs worldlabel > ../bugs.json
fetching Bug #812563 in worldlabel: "there isn't a clear test site setup"
Traceback (most recent call last):
File "bin/lp2gh-export-bugs", line 27, in
o = bugs.export(FLAGS.project)
File "/home/rejon/Software/lp2gh/lp2gh/bugs.py", line 138, in export
rv = bug_task_to_dict(x)
File "/home/rejon/Software/lp2gh/lp2gh/bugs.py", line 86, in bug_task_to_dict
'date_created': util.to_timestamp(bug_task.date_created),
File "/home/rejon/Software/lp2gh/lp2gh/util.py", line 6, in to_timestamp
tt = (dt.year, dt.month, dt.day,
AttributeError: 'unicode' object has no attribute 'year'

@ghost
Copy link
Author

ghost commented Mar 7, 2012

I added a quick fix in you util.py:

import time

GH_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'

def to_timestamp(dt):
fmttime = ''
try:
tt = (dt.year, dt.month, dt.day,
dt.hour, dt.minute, dt.second,
dt.weekday(), 0, 0)
fmttime = dt.strftime(GH_DATE_FORMAT)
except AttributeError:
pass
return fmttime

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

No branches or pull requests

0 participants