◐ Shell
clean mode source ↗

Message 306290 - Python tracker

I disagree. This is an old API, a thin wrapper around standard POSIX API, and returning an empty string instead of None will make impossible to distinguish NULL from "".

It is easy to convert None in an empty string in Python: `value or ''`.

I would change the test to

    if field is not None:
        self.assertIsInstance(field, str)

or

    self.assertIsInstance(field, (str, type(None)))

(I prefer the former variant).