Message207793
Looking back at this: considering we may get errors != EACCESS I think we better be as generic as possible as in:
--- a/Modules/spwdmodule.c
+++ b/Modules/spwdmodule.c
@@ -153,6 +153,8 @@
if ((d = PyList_New(0)) == NULL)
return NULL;
setspent();
+ if (errno != 0)
+ return PyErr_SetFromErrno(PyExc_OSError);
while ((p = getspent()) != NULL) {
PyObject *v = mkspent(p);
if (v == NULL || PyList_Append(d, v) != 0) {
As for 2.7 and 3.3 I have a little concern in terms of backward compatibility as the user will suddenly receive an exception instead of [] but I think that for the sake of correctness the cost is justified. |
|
Date |
User |
Action |
Args |
2014-01-09 21:06:50 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, loewis, akuchling, serhiy.storchaka, vajrasky |
2014-01-09 21:06:50 | giampaolo.rodola | set | messageid: <1389301610.6.0.818073715006.issue10388@psf.upfronthosting.co.za> |
2014-01-09 21:06:50 | giampaolo.rodola | link | issue10388 messages |
2014-01-09 21:06:50 | giampaolo.rodola | create | |
|