unified-font-object / ufoNormalizer

A tool that will normalize the XML and other data inside of a UFO.
Other
51 stars 19 forks source link

Fix crash in normalization of data in lib #47

Closed belluzj closed 6 years ago

belluzj commented 6 years ago

First I'm pushing a test to check that it's not my machine that behaves strangely

There was indeed a problem: https://travis-ci.org/unified-font-object/ufoNormalizer/builds/372927710

anthrotype commented 6 years ago

have you tried passing use_builtin_types=False to plistlib.loads in python3?

If use_builtin_types is true (the default) binary data will be returned as instances of bytes, otherwise it is returned as instances of Data.

https://docs.python.org/3/library/plistlib.html#plistlib.load

belluzj commented 6 years ago

No I didn't, should I change my PR to use that instead?

anthrotype commented 6 years ago

if that works too, maybe yes, as that's supposed to make python3's plistlib work the same as python2.7. I don't like too much that isinstance(..., bytes) branch is only run under python3, as the isinstance(..., basestring) branch above that runs for both unicode and bytes on python2.

belluzj commented 6 years ago

Done :)