Author sdeibel
Recipients
Date 2006-12-04.22:34:06
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In the Linux/Unix (non-Windows / non-OS2) implementation of listdir() in posixmodule.c, a check for errno != 0 is done after the loop.  This assumes that errno is only set by readdir() but in fact it's possible for it to be set in PyUnicode_FromEncodedObject() if codecs are used in the conversion (actually that's a separate bug I'll report when I've investigated it futher).

To tighten this up, I'd recommend moving the errno != 0 clause in its entirety to just after the readdir() call and possibly resetting errno=0 before the readdir() call so it's clear the error really happened there.

I've attached a possible patch for this.
History
Date User Action Args
2007-08-23 14:50:29adminlinkissue1608818 messages
2007-08-23 14:50:29admincreate