Skip to content

Cannot support list of dates in Email Message Header #314

Closed

Description

@gtback

Minimal example to reproduce:

import datetime as dt
from cybox.objects.email_message_object import EmailHeader
hdr = 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

Activity

  1. added a commit that references this issue on Jun 8, 2018
    beb9438
  2. added a commit that references this issue on Jun 11, 2018
  3. added this to the v2.1.0.17 milestone on Jun 11, 2018
  4. modified the milestones: v2.1.0.17, v2.1.0.18 on Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions