This fixes issue #54. The first error was a non-error one. I just mistook it for an error because the error message had misplaced encoding.
The second error is in line 87. It appears the check for content attribute decode was bogus in two ways:
content here may be str or unicode. I properly checked the correct type with six.binary_type.
content was being decoded and then joined (through format()) to a unicode string, due to unicode_literals. This causes format() to try to decode the just-encoded bytes as ASCII, causing the error.
This fixes issue #54. The first error was a non-error one. I just mistook it for an error because the error message had misplaced encoding.
The second error is in line 87. It appears the check for
content
attributedecode
was bogus in two ways:content
here may bestr
orunicode
. I properly checked the correct type withsix.binary_type
.content
was beingdecoded
and then joined (throughformat()
) to aunicode
string, due tounicode_literals
. This causesformat()
to try to decode the just-encoded bytes as ASCII, causing the error.six
as a new dependency shouldn't be a problem since it is recommended by the Pelican contributors blog and is also used by Pelican itself.