[Zope-dev] Re: SVN: Zope/branches/Zope-2_8-branch/ - Collector
#1879: applied patch by Dieter Maurer to fix a bug in
Andreas Jung
lists at andreas-jung.com
Mon Sep 26 12:40:57 EDT 2005
You could convince Dieter to write unittests for his patches :-) On the
other side his patches are in 99% of the cases trustworthy. Otherwise this
bug would remain open.
-aj
--On 26. September 2005 18:31:27 +0200 Florent Guillaume <fg at nuxeo.com>
wrote:
> This is the kind of thing that would *really* benefit from having unit
> tests...
>
> Florent
>
>
> Andreas Jung <andreas at andreas-jung.com> wrote:
>> Log message for revision 38586:
>> - Collector #1879: applied patch by Dieter Maurer to fix a bug
>> in ac_aquire() ignoring the default argument
>>
>>
>> Changed:
>> U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
>> U Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
>>
>> -=-
>> Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
>> ===================================================================
>> --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:01:37 UTC
>> (rev 38585)
>> +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-09-24 12:10:07 UTC
>> (rev 38586)
>> @@ -31,6 +31,9 @@
>>
>> Bugs Fixed
>>
>> + - Collector #1879: applied patch by Dieter Maurer to fix a bug in
>> + ac_aquire() ignoring the default argument
>> +
>> - Collector #1864, #1906: fixed header normalization in
>> appendHeader()
>>
>> - Collector #1899: fixed migration issue when using export/import
>> for
>>
>> Modified:
>> Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
>> =================================================================== ---
>> Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
>> 2005-09-24 12:01:37 UTC (rev 38585)
>> +++ Zope/branches/Zope-2_8-branch/lib/python/Acquisition/_Acquisition.c
>> 2005-09-24 12:10:07 UTC (rev 38586)
>> @@ -1059,6 +1059,7 @@
>> PyObject *expl=0, *defalt=0;
>> int explicit=1;
>> int containment=0;
>> + PyObject *result; /* DM 2005-08-25: argument "default" ignored */
>>
>> UNLESS (PyArg_ParseTupleAndKeywords(
>> args, kw, "O|OOOOi", acquire_args+1,
>> @@ -1070,12 +1071,34 @@
>>
>> if (filter==Py_None) filter=0;
>>
>> + /* DM 2005-08-25: argument "default" ignored -- fix it! */
>> +# if 0
>> return Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
>> explicit ||
>> self->ob_type==(PyTypeObject*)&Wrappertype,
>> explicit, containment);
>> +# else
>> + result = Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
>> + explicit ||
>> + self->ob_type==(PyTypeObject*)&Wrappertype,
>> + explicit, containment);
>> + if (result == NULL && defalt != NULL) {
>> + /* as "Python/bltinmodule.c:builtin_getattr" turn
>> + only 'AttributeError' into a default value, such
>> + that e.g. "ConflictError" and errors raised by the filter
>> + are not mapped to the default value.
>> + */
>> + if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
>> + PyErr_Clear();
>> + Py_INCREF(defalt);
>> + result = defalt;
>> + }
>> + }
>> + return result;
>> +# endif
>> }
>>
>> +
>> static PyObject *
>> Wrapper_inContextOf(Wrapper *self, PyObject *args)
>> {
>
>
> --
> Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
> +33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
> _______________________________________________
> Zope-Dev maillist - Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050926/33367ab1/attachment.bin
More information about the Zope-Dev
mailing list