Error in brine.py with TAG_EMPTY_STR #66

Closed
pyscripter opened this Issue Feb 28, 2012 · 1 comment

Projects

None yet

2 participants

@pyscripter

The following function will produce an error in python 3k.

@register(_load_registry, TAG_EMPTY_STR)
def _load_empty_str(stream):
    return ""

The reason is that it will return a unicode string and later _load_unicode will complain that an str object has no method "decode".

Solution:

if is_py3k:
    @register(_load_registry, TAG_EMPTY_STR)
    def _load_empty_str(stream):
        return b""
else:
    @register(_load_registry, TAG_EMPTY_STR)
    def _load_empty_str(stream):
        return ""
@tomerfiliba tomerfiliba added a commit that closed this issue Feb 28, 2012
@tomerfiliba closes #66 1824a33
@tomerfiliba
Owner

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment