Comment 4 for bug 1418158

Revision history for this message
Gavin Panella (allenap) wrote :

> And besides, I find it nonsensical that in:
>
> client.get(u"nodes/", "list").read()
>
> you think requiring the path be unicode is sensible, but the operation
> can be a string.

I missed adding the prefix to the operation string in my example, that's
all. In MAAS, every single module has (amongst other things):

    from __future__ import unicode_literals
    str = None

at the top. Byte strings **in MAAS** do not qualify as text strings. We
try to be careful about encoding and decoding explicitly. I'm sure we've
missed a few cases because Python 2 makes it trivially easy to do so.

>
> The get() docstring doesn't make you any wiser, either. So I think
> you're wrong wrong wrong :)

The assumption across the whole of MAAS is that strings are unicode, so
it's not specified everywhere. Users of MAAS's code need to treat it as
an all-unicode environment. If/when we migrate to Python 3, this will be
unavoidable.