Problem: new type in Python 2.2

Dave Kuhlman dkuhlman at rexx.com
Wed Jan 16 18:54:21 EST 2002


John Machin <sjmachin at lexicon.net> wrote:
> 
> [heavily snipped]
> "Tim Peters" <tim.one at home.com> wrote in message news:<mailman.1011142047.1218.p
> ython-list at python.org>...
>> [Dave Kuhlman]

[snip]

> 
> <timbait>
> While the Python core is not to blame, the error message *is* produced
> in the Python source, in getargs.c -- it's built up laboriously using
> *snprintf(), so that it can't be detected by
> bot_parser_hacked_up_using_regexes().
> </timbait>
> 
> Suggested plausible scenario: an extension is calling
> PyArg_ParseTuple() with an arg string that tells it to expect a string
> ("s") as the second argument. Two things are going wrong: (1) The
> extensions's caller is passing in a libxslt_stylesheet (whatever that
> is) instead of a string. (2) The extension is not testing the return
> value from PyArg_ParseTuple(), and/or is not returning NULL (not a
> pointer to PyNone, or some other valid PyObject!!) immediately on
> failure. As Tim says, the exception is thrown much later, leading to
> confusion about which source line caused the problem.

How did you know that?  That's precisely what I did.  This is so
spooky.  What percentage of Pythonistas have a telepathic code
reading ability, I wonder.

Thanks for help.

  - Dave


> 
> HTH,
> John

-- 
Dave Kuhlman
dkuhlman at rexx.com
http://www.rexx.com/~dkuhlman


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list