a more defensive way to handle it would be something like this:
```python
def unicodify(value):
    if isinstance(value, bytes):
        return bytes.decode("utf-8") # HACK guess encoding
    return unicode(value)
```
However, this isn't really sustainable because it's wasteful and annoying to have to do type checking and encoding guessing all over the place. The right way is to always convert to unicode when reading data from a byte stream and encode when writing to a byte stream. The (rare) exceptions are protocols that deal strictly with bytes.