[Python-bugs-list] [ python-Bugs-464872 ] PyDict_Check() fails if object not dict

noreply@sourceforge.net noreply@sourceforge.net
Tue, 25 Sep 2001 10:31:53 -0700


Bugs item #464872, was opened at 2001-09-25 09:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470

Category: Python Interpreter Core
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: PyDict_Check() fails if object not dict

Initial Comment:

Calling PyDict_Check() on the keywords object passed
to an built-in extension module callback, when no
keyword arguments were given results in Python raising
an exception, rather than return 0 as it should.

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-25 10:31

Message:
Logged In: YES 
user_id=6380

I haven't seen your code, but I believe you may be seeing
this because the keywords argument can be NULL. 
PyDict_Check() should not be applied to a NULL pointer, so
the proper way to do this is to check for NULL before
calling PyDict_Check().

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=464872&group_id=5470