[Python-checkins] r53672 - in python/branches/release25-maint: Lib/test/test_datetime.py Misc/NEWS Modules/datetimemodule.c

Thomas Wouters thomas at python.org
Wed Feb 14 20:13:20 CET 2007


This should not be backported; it introduces a new exception where there
previously was just working (albeit potentially bugged) code. (I'm working
through some backlog, so apologies if someone caught it already.)

On 2/8/07, martin.v.loewis < python-checkins at python.org> wrote:
>
> Author: martin.v.loewis
> Date: Thu Feb  8 10:13:51 2007
> New Revision: 53672
>
> Modified:
>    python/branches/release25-maint/Lib/test/test_datetime.py
>    python/branches/release25-maint/Misc/NEWS
>    python/branches/release25-maint/Modules/datetimemodule.c
> Log:
> Bug #1653736: Complain about keyword arguments to time.isoformat.
>
>
> Modified: python/branches/release25-maint/Lib/test/test_datetime.py
> ==============================================================================
>
> --- python/branches/release25-maint/Lib/test/test_datetime.py   (original)
> +++ python/branches/release25-maint/Lib/test/test_datetime.py   Thu Feb  8
> 10:13:51 2007
> @@ -1740,6 +1740,11 @@
>          self.assertEqual (t.isoformat(), "00:00:00.100000")
>          self.assertEqual(t.isoformat(), str(t))
>
> +    def test_1653736(self):
> +        # verify it doesn't accept extra keyword arguments
> +        t = self.theclass (second=1)
> +        self.assertRaises(TypeError, t.isoformat, foo=3)
> +
>      def test_strftime(self):
>          t = self.theclass(1, 2, 3, 4)
>          self.assertEqual(t.strftime('%H %M %S'), "01 02 03")
>
> Modified: python/branches/release25-maint/Misc/NEWS
>
> ==============================================================================
> --- python/branches/release25-maint/Misc/NEWS   (original)
> +++ python/branches/release25-maint/Misc/NEWS   Thu Feb  8 10:13:51 2007
> @@ -105,6 +105,8 @@
> Extension Modules
> -----------------
>
> +- Bug #1653736: Complain about keyword arguments to time.isoformat.
> +
> - operator.count() now raises an OverflowError when the count reaches
> sys.maxint.
>
> - Bug #1575169: operator.isSequenceType() now returns False for subclasses
> of dict.
>
> Modified: python/branches/release25-maint/Modules/datetimemodule.c
> ==============================================================================
>
> --- python/branches/release25-maint/Modules/datetimemodule.c    (original)
> +++ python/branches/release25-maint/Modules/datetimemodule.c    Thu Feb  8
> 10:13:51 2007
> @@ -3167,7 +3167,7 @@
> }
>
> static PyObject *
> -time_isoformat(PyDateTime_Time *self)
> +time_isoformat(PyDateTime_Time *self, PyObject *unused)
> {
>         char buf[100];
>         PyObject *result;
> @@ -3411,7 +3411,7 @@
>
> static PyMethodDef time_methods[] = {
>
> -       {"isoformat",   (PyCFunction)time_isoformat,    METH_KEYWORDS,
> +       {"isoformat",   (PyCFunction)time_isoformat,    METH_NOARGS,
>          PyDoc_STR("Return string in ISO 8601 format, HH:MM:SS[.mmmmmm]"
>                    "[+HH:MM].")},
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>



-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-checkins/attachments/20070214/6e5765d7/attachment-0001.htm 


More information about the Python-checkins mailing list