projectmallard / mallard-ducktype

Parser for the lightweight Ducktype syntax for Mallard
MIT License
10 stars 4 forks source link

Opens files with a platform-preferred encoding, which can fail #11

Closed amigadave closed 9 years ago

amigadave commented 9 years ago

In parse_file(), in parser.py, open() is called without an encoding parameter. According to the open documentation the default encoding is platform dependent. It seems that when building RPMs in Koji (for Fedora), the platform encoding is ascii, which causes any non-ASCII sequence to raise an error, like in the dbus ducktype documentation (search for UnicodeDecodeError).

I guess that ducktype should specify an encoding, such as utf-8.