A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/031143.html below:

[Python-Dev] PEP 298

[Python-Dev] PEP 298Thomas Heller theller@python.net
13 Dec 2002 15:02:02 +0100
Jack Jansen <Jack.Jansen@cwi.nl> writes:

> On Thursday, Dec 12, 2002, at 20:10 Europe/Amsterdam, Guido van Rossum
> wrote:
> 
> >> If you call YAGNI, it's ok for me, that's why I'm asking. Better save
> >> the time in this case...
> >
> > Well, I have no personal need for it.  If you're the only one, that
> > sounds like a big YAGNI to me...
> 
> Well... Note that you are currently living dangerously if you're using
> an s# format and access that buffer again after a
> Py_BEGIN_ALLOW_THREADS. If the object passed from Python was a mutable
> object with a buffer interface there's a chance that another thread
> has moved the underlying data.

It can even by the same thread, executing an innocent Py_DECREF()
can execute arbitrary Python code. Thinking of it, it's not clear
what you are allowed to do after PyArg_Parse() if you still need
the 'parsed pointers'.

And that's the main point of the PEP: the 'old' buffer interface
is nearly useless if you want too be safe.

Thomas




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4