Skip to content

Commit 94879aa

Browse files
committed
Manually merge PR156 for python3 case where we need to parse timestamp.
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6174 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent 7632070 commit 94879aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mig/shared/refunctions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def build_reitem_object(configuration, re_dict):
386386
})
387387

388388
created_timestamp = re_dict['CREATED_TIMESTAMP']
389+
# Timestamp should always be set but default to epoch e.g. if None
389390
if isinstance(created_timestamp, basestring):
390391
# NOTE: fromisoformat was only added in python 3.x
391392
try:
@@ -395,6 +396,8 @@ def build_reitem_object(configuration, re_dict):
395396
# Fall back to old fragile parser
396397
created_timestamp = datetime.datetime.strptime(
397398
created_timestamp, '%Y-%m-%d %H:%M:%S.%f')
399+
else:
400+
created_timestamp = datetime.datetime.utcfromtimestamp(0)
398401

399402
created_timetuple = created_timestamp.timetuple()
400403
created_asctime = time.asctime(created_timetuple)

0 commit comments

Comments
 (0)