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 acdha
Recipients acdha, docs@python, terry.reedy, zaytsev
Date 2014-09-30.17:16:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412097381.22.0.767121386578.issue20164@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that making the code match the docs would be preferable – an unexpected KeyError might be easier to track down that way but it'd still surprise most developers.

re:pwd docs, the formatting in https://hg.python.org/cpython/file/8e9df3414185/Doc/library/pwd.rst makes it easy to miss the KeyError note – it's at the end of a paragraph after a table and since "entry" is a generic term it's possible to misread it as applying to fields within the record rather than the record itself. I think it would at least be worth adding a newline and perhaps explicitly noting that it applies to any function which returns a password database entry. 

Given that there are only two functions which it applies to, it might be best to simply add a note to each of them for people who use "pydoc pwd.getpwduid" or an IDE and don't see the module-level docs but that's getting a bit contrived.
History
Date User Action Args
2014-09-30 17:16:21acdhasetrecipients: + acdha, terry.reedy, docs@python, zaytsev
2014-09-30 17:16:21acdhasetmessageid: <1412097381.22.0.767121386578.issue20164@psf.upfronthosting.co.za>
2014-09-30 17:16:21acdhalinkissue20164 messages
2014-09-30 17:16:20acdhacreate