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 pitrou
Recipients pitrou, sbt
Date 2012-06-30.20:46:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341089172.58.0.278128754635.issue15229@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a quick patch (needs a test):

diff --git a/Objects/exceptions.c b/Objects/exceptions.c
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -834,6 +834,7 @@ oserror_init(PyOSErrorObject *self, PyOb
 #endif
 
     /* Steals the reference to args */
+    Py_CLEAR(self->args);
     self->args = args;
     args = NULL;
 
@@ -916,6 +917,11 @@ OSError_new(PyTypeObject *type, PyObject
             ))
             goto error;
     }
+    else {
+        self->args = PyTuple_New(0);
+        if (self->args == NULL)
+            goto error;
+    }
 
     return (PyObject *) self;
History
Date User Action Args
2012-06-30 20:46:12pitrousetrecipients: + pitrou, sbt
2012-06-30 20:46:12pitrousetmessageid: <1341089172.58.0.278128754635.issue15229@psf.upfronthosting.co.za>
2012-06-30 20:46:12pitroulinkissue15229 messages
2012-06-30 20:46:11pitroucreate