[py-dev] revising exception handling / help appreciated

Laura Creighton lac at strakt.com
Sun Jan 2 18:30:39 CET 2005


Something that is germane to this discussion:

Most users (and we tested them, somewhere I have hard evidence for this) do
not see the E_WHATEVER part of their error message at all.  They parse all
error messages that show up as:

ERROR: <some text>.

So when faced with:

EPERM: /etc/hedgehog or
ENOENT: /etc/hedgehog

there is no part of their brain going 'what is an EPERM'?  Their brain thinks it
already knows all it needs to know about EPERM: it means there is an error.  So what
they do is go take a look at /etc/hedgehog and see if they can reason out what
must be wrong.  If they cannot find the file, they figure it out.  If they can
and it is owned by the wrong person, then they can, assuming they know about
permissions.  But my job was to see what confused them.  When we mounted the 
filesystem read-only, they _couldn't_ figure it out.  They didn't know that this 
was possible, and so didn't imagine that.

Making the ETEXT_THEY_READ longer only had a limited effect.  _Telling_ them
that they should look these up in the manuals we provided had some effect.  But
the only real fix was long error messages.  If you look at messages in newbie
forums  all over, you will see that things have not changed.  Newbies are still
asking 'What does "Operation not permitted" mean'? rather than 'What does 
"EPERM: Operation not permitted" mean.  Bug reports still exclude the perfectly
vital piece of information the programmer needs to figure out exactly what went
wrong 'because I didn't think that was important'.

We had better take special care with errors new users can get trying to install
and use pytest for the very first time.  We don't want them to get frustrated
and decide that _unit testing_ is too hard for them.

Laura





More information about the Pytest-dev mailing list