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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --Boundary_(ID_vMCz5ViBlR+cRcfYa3EOag) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: quoted-printable Hi python-list,=0A=0AI'm embedding Python in an application and I have enc= ountered two crashes while calling built-in functions that expect a top-le= vel frame. See the following bug reports:=A0http://bugs.python.org/issue21= 563=A0and http://bugs.python.org/issue21418.=A0The problem is that the wor= kflow for embedding the Python interpreter does not involve creation of a = frame.=A0RubyPython, a language interface to call Python from Ruby, has th= e same problem,=A0http://rubypython.rubyforge.org/#known-problems. Since t= here 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 glob= als and locals can be passed as optional arguments. The crashes, however, = are more unfortunate.=A0=0A=0AAs an example, I can crash RubyPython by cal= ling the built-in function execfile with a single argument.=0A=0Airb(main)= :001:0> require('rubypython')=0AC:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bl= ankslate-3.1.2/lib/blankslate.rb:51: warning: undefining `object_id' may c= ause serious problems=0A=3D> true=0Airb(main):002:0> RubyPython.start=0A=3D= > true=0Airb(main):003:0> binmod =3D RubyPython.import('__builtin__')=0A=3D= > =0Airb(main):004:0> binmod.execfile('fo= o.py')=0A=0AThe fourth line crashed the ruby interpreter. This is an examp= le 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 with= out restricting the API.=0A=0AI am curious if anyone has suggestions for c= reating a top-level frame?=0A=0AThank you,=0ARob =A0=0A=0A=0A=0A= --Boundary_(ID_vMCz5ViBlR+cRcfYa3EOag) Content-type: multipart/related; boundary="Boundary_(ID_HqzqoWwBv3GxvaS3IRWeuQ)"; type="text/html" --Boundary_(ID_HqzqoWwBv3GxvaS3IRWeuQ) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable
Hi python-list,

I'm embedding Python in an a= pplication and I have encountered two crashes while calling built-in funct= ions that expect a top-level frame. See the following bug reports: http://bugs.python.org/iss= ue21563 and http://= bugs.python.org/issue21418. The problem is that the workflow for= embedding the Python interpreter does not involve creation of a frame.&nb= sp;RubyPython, a language interfa= ce 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 wor= ked-around because globals and locals can be passed as optional arguments.= The crashes, however, are more unfortunate. 

As an example, I can cra= sh RubyPython by calling the built-in function execfile with a single argu= ment.

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 probl= ems
=3D> true
irb(main):002:0> RubyPython= .start
=3D> true
irb(main):003:0> binmod =3D Rub= yPython.import('__builtin__')
=3D> <module '__builtin__' (= built-in)>
irb(main):004:0> binmod.execfile('fo= o.py')

=
The fourth line crashed the ruby interpreter. This is an example wher= e an application might want to give full access to the functions in a Pyth= on module. It would be nice to find a way to prevent the crash without res= tricting the API.

<= /div>
I am curious if anyone has sug= gestions for creating a top-level frame?

= Thank you,
Rob  



= --Boundary_(ID_HqzqoWwBv3GxvaS3IRWeuQ)-- --Boundary_(ID_vMCz5ViBlR+cRcfYa3EOag)--