RuntimeError on google app engine

6 views
Skip to first unread message

quano

unread,
Feb 10, 2010, 1:35:22 PM2/10/10
to minifb
I'm using google app engine and cannot get this to work. I'm making a
call to facebook (users.isVerified), and this is what I get back:

File "/base/data/home/apps/x/1.339792748057786391/
minifb.py", line 178, in call
md5hash.update(_Hashable(secret))
File "/base/data/home/apps/x/1.339792748057786391/
minifb.py", line 265, in _Hashable
value = buffer(value)
RuntimeError: cannot create buffer objects in restricted execution
mode

peteshinners

unread,
Feb 11, 2010, 12:04:53 AM2/11/10
to minifb
This is coming from the "Facebook Secret" object. It encapsulates your
facebook developer key in something that isn't a string, so that
pretty tracebacks in your errors do not include the string value. A
buffer object is something that Python has that works like a string,
but isn't a string.

In the short term, you could change the FacebookSecret class to just
use a string internally. The way that the string is encapsulated, I
doubt any error reporting would ever reveal the secret. I'll have to
use something else though so that it works on Google App Engine. I
should be able to get a new version during Pycon in the next few days?

On Feb 10, 10:35 am, quano <sweken...@gmail.com> wrote:
> I'm using google app engine and cannot get this to work. I'm making a
> call to facebook (users.isVerified), and this is what I get back:

> RuntimeError: cannot create buffer objects in restricted execution
> mode

peteshinners

unread,
Feb 20, 2010, 9:18:26 AM2/20/10
to minifb
This was just fixed. Everything should work on Google App Engine
again, but I don't have a great way to test it.

kscott

unread,
Apr 4, 2010, 5:17:54 PM4/4/10
to minifb
In addition, the the python buffer command is not allowed in Google
App Engine.

kscott

unread,
Apr 4, 2010, 5:28:47 PM4/4/10
to minifb
Here a quote from the python documentation (http://docs.python.org/c-
api/buffer.html)

Python objects implemented in C can export a group of functions called
the “buffer interface.” These functions can be used by an object to
expose its data in a raw, byte-oriented format. Clients of the object
can use the buffer interface to access the object data directly,
without needing to copy it first.

So because the buffer links to native C code it will not be allowed to
run in the Google App Engine.

kscott

unread,
Apr 5, 2010, 8:49:45 PM4/5/10
to minifb
In addition, the memoryview directive is is not allowed.

The following code from minifb version 1.2 is not allowed to run in
appengine:

def buffer(value):
if isinstance(value, str):
return memoryview(value.encode())
return memoryview(value)

Reply all
Reply to author
Forward
0 new messages