This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka, vstinner, xdegaye
Date 2017-11-15.17:41:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510767689.91.0.213398074469.issue32033@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2017-11-15 17:41:29serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, xdegaye
2017-11-15 17:41:29serhiy.storchakasetmessageid: <1510767689.91.0.213398074469.issue32033@psf.upfronthosting.co.za>
2017-11-15 17:41:29serhiy.storchakalinkissue32033 messages
2017-11-15 17:41:29serhiy.storchakacreate