Skip to content

Next release#286

Merged
clenk merged 74 commits intomasterfrom
next-release
Jul 29, 2016
Merged

Next release#286
clenk merged 74 commits intomasterfrom
next-release

Conversation

@clenk
Copy link
Contributor

@clenk clenk commented Jul 27, 2016

Currently fails on Sphinx doctests because the str() function of datetime.datetime is equivalent to calling .isoformat(' ') on it [1], which replaces the 'T' with a space. This results in an invalid timestamp.

For a truncated example:

File "examples.rst", line 513, in default
Failed example:
from cybox.objects.email_message_object import EmailMessage
e = EmailMessage()
e.date = "Mon, 14 Oct, 2013 12:32:03 -0500"
print(e.to_xml(include_namespaces=False, encoding=None))
Expected:
<EmailMessageObj:Date>2013-10-14T12:32:03-05:00</EmailMessageObj:Date>
Got:
<EmailMessageObj:Date>2013-10-14 12:32:03-05:00</EmailMessageObj:Date>

I'm not sure of the best place to put code to fix this, though. Maybe in cybox/utils/init.py, in normalize_to_xml() [2], we could check if value is instance of datetime.datetime and if so use value.isoformat() instead of text_type(value)?

gtback and others added 30 commits July 26, 2015 13:23
…nch off of v2.1.0.11 tag to apply the type_ field changes.
Changes in build() methods to support strong bindings for cybox objects
to mixbox (in a branch of the same name as this).
and from_obj() methods.

* Added VocabFactory class to vocabs module.
* Refactored VocabString to use TypedFields.
* Refactored VocabField to use VocabFactory.
* Added ObjectPropertiesFactory class to use for ObjectProperties
  xsi:type resolution.
* Still lots of unit test failures!
* Added ListFieldMixin class that allows TypedFields to be set to a
  list of values or a single value. This is used by all
  BaseProperty concrete classes.
* Added several ListFieldMixin implementations to BaseProperty
  subclass value TypedFields.
* Fixed several datatype mismatch bugs between the API and binding
  classes.
module.

* The Artifact.packaging field is still not a TypedField and could
  take a lot of work to get there.
* Added EncodingFactory, EncryptionFactory, and CompressionFactory
  classes.
* Removed factory functionality from the Compression and
  Encryption classes (get_object()).
chisholm and others added 22 commits March 1, 2016 16:19
Complements Bryan's one_pass_namespaces "cleanup" mixbox PR
vocab (class) it's checking, not just the set of allowed values.
Typedfields branch fixes to nosetests
doesn't look all messed up under python3.
The code
  ustr = six.u("<some utf8 bytes>")

doesn't do what the original author thought it did under python2.
That's a narrow char string of utf8 bytes, and six.u() is hard-coded
to decode using the "unicode_escape" encoding, which is the "\u1234"
syntax.  There are no unicode escapes there, so a proper decoding
never happens.  I fixed it to use unicode escapes instead of utf8
encoded literals.
@gtback gtback self-assigned this Jul 27, 2016
@clenk clenk merged commit 830387d into master Jul 29, 2016
@clenk
Copy link
Contributor Author

clenk commented Jul 29, 2016

Thanks, @gtback!

@clenk clenk deleted the next-release branch July 29, 2016 12:03
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

Successfully merging this pull request may close these issues.

5 participants