Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71943

how to create a frame object when embedding python?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <robert.snoeberger@icloud.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'api.': 0.05; 'interpreter': 0.05; 'interpreter.': 0.07; 'properly.': 0.09; 'ruby,': 0.09; 'subject:create': 0.09; 'python': 0.11; 'bug': 0.12; 'argument.': 0.16; 'crashed': 0.16; 'globals': 0.16; 'message-id:@me.com': 0.16; 'optional': 0.16; 'python-list,': 0.16; 'received:mac.com': 0.16; 'restricting': 0.16; 'skip:r 90': 0.16; 'subject:object': 0.16; 'subject:when': 0.16; 'top-level': 0.16; 'subject:python': 0.16; 'prevent': 0.16; 'language': 0.16; 'example': 0.22; 'creating': 0.23; 'skip:c 70': 0.24; 'function': 0.29; 'url:bugs': 0.29; "i'm": 0.30; "skip:' 10": 0.31; 'crash': 0.31; 'embedding': 0.31; 'anyone': 0.31; 'interface': 0.32; 'url:python': 0.33; 'problem': 0.35; 'there': 0.35; 'curious': 0.36; 'module.': 0.36; 'object,': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'example,': 0.37; 'application': 0.37; 'two': 0.37; 'easily': 0.37; 'thank': 0.38; 'problems': 0.38; 'received:17': 0.38; 'to:addr:python-list': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; '8bit%:6': 0.40; 'skip:u 10': 0.60; 'most': 0.60; 'full': 0.61; 'more': 0.64; 'content-type:multipart/related': 0.67; 'skip:r 30': 0.69; 'fourth': 0.84; 'reports:': 0.84; 'serious': 0.97
MIME-version 1.0
Content-type multipart/alternative; boundary="Boundary_(ID_vMCz5ViBlR+cRcfYa3EOag)"
To python-list@python.org
From Robert Snoeberger <robert.snoeberger@icloud.com>
Subject how to create a frame object when embedding python?
Date Fri, 23 May 2014 20:52:33 +0000 (GMT)
X-Mailer iCloud MailClient14C.131978 MailServer14D24.16024
X-Originating-IP [144.212.3.4]
X-MANTSH 1TEIXWV4bG1oaGkdHB0lGUkdDRl5PWBoaHxEKTEMXGx0EGx0YBBIZBBsTEBseGh8 aEQpYTRdLEQptfhcaEQpMWRcbGhsbEQpZSRcRClleF2hueREKQ04XSxseGmJCHx1SHhN9GXhzB x5kGBofGEsRClhcFxkEGgQbGwdNTh8YGBgZSwUbHQQbHRgEEhkEGxMQGx4aHxsRCl5ZF2FefEd cEQpDWhcbHQQbHRgEGBgaBBgeHBEKQl4XGxEKQkUXaAVlGGN9ZEh7Q3gRCkJOF2tFGlJQHkNcW VxoEQpCTBdjHG9TfXgBQ0drUBEKQmwXa0RnWGNfXngSYU8RCkJAF2JjH2RPThlGW0lyEQpCWBd hWnJnexJkaF1mUBEKcGgXehJFc2B8RgF6aG8RCnBoF2FPRUtcREJpHB9wEQpwaBdkXkVweXxsA UZZUBEKcGgXbWkcQVB5X2MdRn8RCnBoF2wfWB8TY34aeVBEEQpwfxd6RWBAf2FTcmVcXxEKcF8 XYVpnemRnb3l/RRoRCnB/F21ce09vSRhLXkdfEQpwXxdkeX4eeURiQXNATBEKcGwXaHgdYEQcQ 3pmUnwRCnBDF2t7bhtgbmJSWl1nEQ==
X-CLX-Spam false
X-CLX-Score 1011
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-05-23_07:2014-05-23,2014-05-23,1970-01-01 signatures=0
X-Proofpoint-Spam-Details rule=notspam policy=default score=0 spamscore=0 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1405230260
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10255.1400881973.18130.python-list@python.org> (permalink)
Lines 77
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400881973 news.xs4all.nl 2867 [2001:888:2000:d::a6]:50946
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71943

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi python-list,

I'm embedding Python in an application and I have encountered two crashes while calling built-in functions that expect a top-level frame. See the following bug reports: http://bugs.python.org/issue21563 and http://bugs.python.org/issue21418. The problem is that the workflow for embedding the Python interpreter does not involve creation of a frame. RubyPython, a language interface to call Python from Ruby, has the same problem, http://rubypython.rubyforge.org/#known-problems. Since there is not a top-level frame object, some built-in functions do not work properly. In most cases, this problem is easily worked-around because globals and locals can be passed as optional arguments. The crashes, however, are more unfortunate. 

As an example, I can crash RubyPython by calling the built-in function execfile with a single argument.

irb(main):001:0> require('rubypython')
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/blankslate-3.1.2/lib/blankslate.rb:51: warning: undefining `object_id' may cause serious problems
=> true
irb(main):002:0> RubyPython.start
=> true
irb(main):003:0> binmod = RubyPython.import('__builtin__')
=> <module '__builtin__' (built-in)>
irb(main):004:0> binmod.execfile('foo.py')

The fourth line crashed the ruby interpreter. This is an example where an application might want to give full access to the functions in a Python module. It would be nice to find a way to prevent the crash without restricting the API.

I am curious if anyone has suggestions for creating a top-level frame?

Thank you,
Rob  



Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

how to create a frame object when embedding python? Robert Snoeberger <robert.snoeberger@icloud.com> - 2014-05-23 20:52 +0000

csiph-web