Skip to content

Cannot support list of dates in Email Message Header #314

Description

@gtback

Minimal example to reproduce:

importdatetimeasdtfromcybox.objects.email_message_objectimportEmailHeaderhdr=EmailHeader()
hdr.date= [dt.datetime.now(), dt.datetime.now()]
hdr.to_xml()

Returns:

~/code/mixbox/mixbox/dates.py in serialize_datetime(value)
39 if not value:
40 return None
---> 41 return value.isoformat()
42 43 AttributeError: 'list' object has no attribute 'isoformat'

I'm not sure the best place to fix this. It may be using cybox.properties.ListDateTimeField rather than cybox.properties.DateTime with a normal TypedField. But this change would probably need to be more pervasive than just this one field. It needs more investigation.

From STIXProject/python-stix#350

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions