From nitralime at googlemail.com Sun Apr 10 14:27:41 2011 From: nitralime at googlemail.com (Nitralime) Date: Sun, 10 Apr 2011 16:27:41 +0200 Subject: [clpython-devel] strange behaviour of python and mixed interpreters Message-ID: <4DA1BE5D.60004@gmail.com> /*Hi folks!*/ I have installed clpython recently and encountered some problems while playing around with the provided interpreter modes. Here is a sample SLIME session -------------------------------------------------------------------------------- ; SLIME 2011-01-28 *CL-USER> (ql:quickload :clpython)* To load "clpython": Load 1 ASDF system: clpython ; Loading "clpython" ......... CLPython quick start guide: Run a string of Python code: (CLPYTHON:RUN "for i in range(4): print i") Run a Python file: (CLPYTHON:RUN #p"~/example/foo.py") Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP :CLPYTHON) (:CLPYTHON) *CL-USER> (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX)* ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is set. ;; Python variables will be interned in the #. ;; To exit the mixed mode: (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) ; No value *CL-USER> (+ 2 3)* -------------------------------------------------------------------------------- At this point the SLIME doesn't return back! I tested it also using a python expression. The same behaviour! C-c C-c drops the session into dubugger which in turn is not responsive! To terminate it the whole process must be killed. Tab completion also leads to a hanging emacs! ############################################################################### In a linux console it behaves differently but not exactly as described in the documentation. Here is a sample session: -------------------------------------------------------------------------------- *$ rlwrap sbcl* This is SBCL 1.0.47, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distribution for more information. ** (ql:quickload :clpython)* To load "clpython": Load 1 ASDF system: clpython ; Loading "clpython" ......... CLPython quick start guide: Run a string of Python code: (CLPYTHON:RUN "for i in range(4): print i") Run a Python file: (CLPYTHON:RUN #p"~/example/foo.py") Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP :CLPYTHON) (:CLPYTHON) ** (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX)* ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is set. ;; Python variables will be interned in the #. ;; To exit the mixed mode: (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) * (+ 2 3) 5 ** def double (n):* *return 2*n* # ** double (4)* 8 ** (double 4)* ; in: DOUBLE 4 ; (DOUBLE 4) ; ; caught STYLE-WARNING: ; undefined function: DOUBLE ; ; compilation unit finished ; Undefined function: ; DOUBLE ; caught 1 STYLE-WARNING condition debugger invoked on a UNDEFINED-FUNCTION in thread #: The function SB-ALIEN:DOUBLE is undefined. Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (SB-KERNEL::UNDEFINED-FUN-ERROR-HANDLER # #.(SB-SYS:INT-SAP #X7FFFF69F7480) # (21)) 0] 0 * -------------------------------------------------------------------------------- The evaluation of "(double 4)" fails. ################################################################################ There is also a problem with python repl: ; SLIME 2011-01-28 *CL-USER> (ql:quickload :clpython)* To load "clpython": Load 1 ASDF system: clpython ; Loading "clpython" ......... CLPython quick start guide: Run a string of Python code: (CLPYTHON:RUN "for i in range(4): print i") Run a Python file: (CLPYTHON:RUN #p"~/example/foo.py") Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP :CLPYTHON) (:CLPYTHON) *CL-USER> (push "/usr/lib/python2.7" *clpython-module-search-paths*)* ("/usr/lib/python2.7") *CL-USER> (clpython:repl)* Welcome to CLPython, an implementation of Python in Common Lisp. Running on: SBCL 1.0.47 REPL shortcuts: `:q' = quit, `:h' = help. Using 1 default module search paths set in *CLPYTHON-MODULE-SEARCH-PATHS* *>>> import os* ;; Parsing #P"/usr/lib/python2.7/os.py" into #P"/usr/lib/python2.7/os.py.lisp" ;; Error occured while reading input with the Python readtable: ;; UnexpectedEofError: Unexpected end of file (line 752). ;; Standard IO syntax (*readtable* etc) has been activated to enable debugging. --- Debugger window ---------------------------------- UnexpectedEofError: Unexpected end of file (line 752). [Condition of type CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] Restarts: 0: [RETRY] Retry evaluating this top-level form in module `__main__' 1: [ERROR] Skip this top-level form in module `__main__' 2: [RETRY-REPL-EVAL] Retry the expression: "import os" 3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level 4: [RETRY] Retry SLIME REPL evaluation request. 5: [*ABORT] Return to SLIME's top level. --more-- Just for testing purpose I have commented the following code block in os.py ----------------------------------------------- /..... 742 if not _exists("urandom"): 743 def urandom(n): 744 """urandom(n) -> str 745 746 Return a string of n random bytes suitable for cryptographic use. 747 748 """ 749 try: 750 _urandomfd = open("/dev/urandom", O_RDONLY) 751 except (OSError, IOError): 752 raise NotImplementedError("/dev/urandom (or equivalent) not found") 753 try: 754 bs = b"" 755 while n > len(bs): 756 bs += read(_urandomfd, n - len(bs)) 757 finally: 758 close(_urandomfd) 759 return bs/ ------------------------------------------------- and tried the "import os" again and got the same error: --- Debugger window ---------------------------------- UnexpectedEofError: Unexpected end of file. [Condition of type CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] Restarts: 0: [RETRY] Retry evaluating this top-level form in module `__main__' 1: [ERROR] Skip this top-level form in module `__main__' 2: [RETRY-REPL-EVAL] Retry the expression: "import os" 3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level 4: [RETRY] Retry SLIME REPL evaluation request. 5: [*ABORT] Return to SLIME's top level. --more-- The situation under Clozure is even worse! The mixed interpreter doesn't work neither in SLIME nor directly in linux console.The python repl behaviour is similar to that of SBCL. I'm using Clozure 1.6-r14468M and SBCL 1.0.47 on Linux 64bit. The installed version of clpython ist "clpython-20110219-git". Are these known issues or am I missing something here? Any feedback is very much appreciated! Regards Nik -------------- next part -------------- An HTML attachment was scrubbed... URL: From nitralime at googlemail.com Sun Apr 10 14:31:39 2011 From: nitralime at googlemail.com (Nitralime) Date: Sun, 10 Apr 2011 16:31:39 +0200 Subject: [clpython-devel] Python extension modules Message-ID: <4DA1BF4B.8090805@gmail.com> Hi! Can the Python (C-)extension modules be used in clpython? Which Python version does clpython implement? Regards Nik -------------- next part -------------- An HTML attachment was scrubbed... URL: From metawilm at gmail.com Thu Apr 14 22:24:00 2011 From: metawilm at gmail.com (Willem Broekema) Date: Fri, 15 Apr 2011 00:24:00 +0200 Subject: [clpython-devel] strange behaviour of python and mixed interpreters In-Reply-To: <4DA1BE5D.60004@gmail.com> References: <4DA1BE5D.60004@gmail.com> Message-ID: Hi Nik, Thanks for trying it out, and for reporting these issues. Enabling the mixed mode sets a custom *readtable* which means all input is caught and treated specially. This might very well clash with what Slime expects, I have not tested that. Of course it *should* work fine under Slime one day... Without testing it, I suppose (double 4) fails because the symbol DOUBLE is unaffected by the "def double ..". The lower-case symbol should work: (|double| 4). The docs are based on the behavior in Allegro in Modern mode. Perhaps the mixed-mode should have parameters to control case, so cross-referencing Python and Lisp objects by default does "the right thing". Thanks again for the reports, I'll work on them. - Willem On Sun, Apr 10, 2011 at 4:27 PM, Nitralime wrote: > *Hi folks!* > > I have installed clpython recently and encountered some problems > while playing around with the provided interpreter modes. > > Here is a sample SLIME session > > -------------------------------------------------------------------------------- > ; SLIME 2011-01-28 > *CL-USER> (ql:quickload :clpython)* > To load "clpython": > Load 1 ASDF system: > clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > Run a string of Python code: (CLPYTHON:RUN "for i in range(4): > print i") > Run a Python file: (CLPYTHON:RUN > #p"~/example/foo.py") > Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > To start mixed Python/Lisp input mode: > (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP > :CLPYTHON) > > (:CLPYTHON) > > *CL-USER> (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX)* > ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is > set. > ;; Python variables will be interned in the #. > ;; To exit the mixed mode: (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) > ; No value > *CL-USER> (+ 2 3)* > > > -------------------------------------------------------------------------------- > > At this point the SLIME doesn't return back! > I tested it also using a python expression. The same behaviour! > C-c C-c drops the session into dubugger which in turn is not responsive! > To terminate it the whole process must be killed. > > Tab completion also leads to a hanging emacs! > > > ############################################################################### > > In a linux console it behaves differently but not exactly > as described in the documentation. Here is a sample session: > > > -------------------------------------------------------------------------------- > *$ rlwrap sbcl* > This is SBCL 1.0.47, an implementation of ANSI Common Lisp. > More information about SBCL is available at > . > > SBCL is free software, provided as is, with absolutely no warranty. > It is mostly in the public domain; some portions are provided under > BSD-style licenses. See the CREDITS and COPYING files in the > distribution for more information. > ** (ql:quickload :clpython)* > To load "clpython": > Load 1 ASDF system: > clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > Run a string of Python code: (CLPYTHON:RUN "for i in range(4): > print i") > Run a Python file: (CLPYTHON:RUN > #p"~/example/foo.py") > Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > To start mixed Python/Lisp input mode: > (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP > :CLPYTHON) > > (:CLPYTHON) > > ** (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX)* > ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is > set. > ;; Python variables will be interned in the # "COMMON-LISP-USER">. > ;; To exit the mixed mode: > (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) > * (+ 2 3) > > 5 > ** def double (n):* > * return 2*n* > > # > ** double (4)* > > 8 > ** (double 4)* > > ; in: DOUBLE 4 > ; (DOUBLE 4) > ; > ; caught STYLE-WARNING: > ; undefined function: DOUBLE > ; > ; compilation unit finished > ; Undefined function: > ; DOUBLE > ; caught 1 STYLE-WARNING condition > > debugger invoked on a UNDEFINED-FUNCTION in thread # "initial thread" > RUNNING > {1002980D01}>: > The function SB-ALIEN:DOUBLE is undefined. > > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. > > restarts (invokable by number or by possibly-abbreviated name): > 0: [ABORT] Exit debugger, returning to top level. > > (SB-KERNEL::UNDEFINED-FUN-ERROR-HANDLER > # > #.(SB-SYS:INT-SAP #X7FFFF69F7480) > # (STRUCT > > SB-VM::OS-CONTEXT-T-STRUCT))> > (21)) > 0] 0 > > * > > -------------------------------------------------------------------------------- > > The evaluation of "(double 4)" fails. > > > ################################################################################ > > There is also a problem with python repl: > > ; SLIME 2011-01-28 > *CL-USER> (ql:quickload :clpython)* > To load "clpython": > Load 1 ASDF system: > clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > Run a string of Python code: (CLPYTHON:RUN "for i in range(4): > print i") > Run a Python file: (CLPYTHON:RUN > #p"~/example/foo.py") > Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > To start mixed Python/Lisp input mode: > (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > Run the test suite: (ASDF:OPERATE 'ASDF:TEST-OP > :CLPYTHON) > > > (:CLPYTHON) > *CL-USER> (push "/usr/lib/python2.7" *clpython-module-search-paths*)* > ("/usr/lib/python2.7") > > *CL-USER> (clpython:repl)* > Welcome to CLPython, an implementation of Python in Common Lisp. > Running on: SBCL 1.0.47 > REPL shortcuts: `:q' = quit, `:h' = help. > Using 1 default module search paths set in *CLPYTHON-MODULE-SEARCH-PATHS* > *>>> import os* > ;; Parsing #P"/usr/lib/python2.7/os.py" into > #P"/usr/lib/python2.7/os.py.lisp" > > ;; Error occured while reading input with the Python readtable: > ;; UnexpectedEofError: Unexpected end of file (line 752). > ;; Standard IO syntax (*readtable* etc) has been activated to enable > debugging. > > --- Debugger window ---------------------------------- > UnexpectedEofError: Unexpected end of file (line 752). > [Condition of type > CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] > > Restarts: > 0: [RETRY] Retry evaluating this top-level form in module `__main__' > 1: [ERROR] Skip this top-level form in module `__main__' > 2: [RETRY-REPL-EVAL] Retry the expression: "import os" > 3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level > 4: [RETRY] Retry SLIME REPL evaluation request. > 5: [*ABORT] Return to SLIME's top level. > --more-- > > > Just for testing purpose I have commented the following code block in os.py > > > ----------------------------------------------- > *..... > 742 if not _exists("urandom"): > 743 def urandom(n): > 744 """urandom(n) -> str > 745 > 746 Return a string of n random bytes suitable for cryptographic > use. > 747 > 748 """ > 749 try: > 750 _urandomfd = open("/dev/urandom", O_RDONLY) > 751 except (OSError, IOError): > 752 raise NotImplementedError("/dev/urandom (or equivalent) not > found") > 753 try: > 754 bs = b"" > 755 while n > len(bs): > 756 bs += read(_urandomfd, n - len(bs)) > 757 finally: > 758 close(_urandomfd) > 759 return bs* > ------------------------------------------------- > > and tried the "import os" again and got the same error: > > --- Debugger window ---------------------------------- > UnexpectedEofError: Unexpected end of file. > [Condition of type > CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] > > Restarts: > 0: [RETRY] Retry evaluating this top-level form in module `__main__' > 1: [ERROR] Skip this top-level form in module `__main__' > 2: [RETRY-REPL-EVAL] Retry the expression: "import os" > 3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level > 4: [RETRY] Retry SLIME REPL evaluation request. > 5: [*ABORT] Return to SLIME's top level. > --more-- > > > The situation under Clozure is even worse! The mixed interpreter doesn't > work > neither in SLIME nor directly in linux console.The python repl behaviour is > > similar to that of SBCL. > > I'm using Clozure 1.6-r14468M and SBCL 1.0.47 on Linux 64bit. > The installed version of clpython ist "clpython-20110219-git". > > Are these known issues or am I missing something here? > > Any feedback is very much appreciated! > > Regards > Nik > > > > > > > _______________________________________________ > clpython-devel mailing list > clpython-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/clpython-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdn at math.carleton.ca Thu Apr 14 22:45:06 2011 From: jdn at math.carleton.ca (Jason Nielsen) Date: Thu, 14 Apr 2011 18:45:06 -0400 (EDT) Subject: [clpython-devel] strange behaviour of python and mixed interpreters In-Reply-To: References: <4DA1BE5D.60004@gmail.com> Message-ID: Hi Nik and Willem, The keyboard locking up when trying to use tab completion is a slime issue, see: https://bugs.launchpad.net/slime/+bug/690424 Cheers, Jason On Fri, 15 Apr 2011, Willem Broekema wrote: > Hi Nik, > Thanks for trying it out, and for reporting these issues. Enabling the mixed mode sets a custom *readtable* which means all input is > caught and treated specially. This might very well clash with what Slime expects, I have not tested that. Of course it *should* work > fine under Slime one day... > > Without testing it, I suppose (double 4) fails because the symbol DOUBLE is unaffected by the "def double ..". The lower-case symbol > should work: (|double| 4). The docs are based on the behavior in Allegro in Modern mode.?Perhaps the mixed-mode should have > parameters to control case, so cross-referencing Python and Lisp objects by default does "the right thing". > > Thanks again for the reports, I'll work on them. > > - Willem > > > On Sun, Apr 10, 2011 at 4:27 PM, Nitralime wrote: > Hi folks! > > I have installed clpython recently and encountered some problems > while playing around with the provided interpreter modes. > > Here is a sample SLIME session > -------------------------------------------------------------------------------- > ; SLIME 2011-01-28 > CL-USER> (ql:quickload :clpython) > To load "clpython": > ? Load 1 ASDF system: > ??? clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > ? Run a string of Python code:?????????? (CLPYTHON:RUN "for i in range(4): print i") > ? Run a Python file:???????????????????? (CLPYTHON:RUN #p"~/example/foo.py") > ? Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > ? To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > ? Run the test suite:??????????????????? (ASDF:OPERATE 'ASDF:TEST-OP > ?????????????????????????????????????????????????????? :CLPYTHON) > > (:CLPYTHON) > > CL-USER> (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is set. > ;; Python variables will be interned in the #. > ;; To exit the mixed mode: (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) > ; No value > CL-USER> (+ 2 3) > > -------------------------------------------------------------------------------- > > At this point the SLIME doesn't return back! > I tested it also using a python expression. The same behaviour! > C-c C-c drops the session into dubugger which in turn is not responsive! > To terminate it the whole process must be killed. > > Tab completion also leads to a hanging emacs! > > ############################################################################### > > In a linux console it behaves differently but not exactly > as described in the documentation. Here is a sample session: > > -------------------------------------------------------------------------------- > $ rlwrap sbcl > This is SBCL 1.0.47, an implementation of ANSI Common Lisp. > More information about SBCL is available at . > > SBCL is free software, provided as is, with absolutely no warranty. > It is mostly in the public domain; some portions are provided under > BSD-style licenses.? See the CREDITS and COPYING files in the > distribution for more information. > * (ql:quickload :clpython) > To load "clpython": > ? Load 1 ASDF system: > ??? clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > ? Run a string of Python code:?????????? (CLPYTHON:RUN "for i in range(4): print i") > ? Run a Python file:???????????????????? (CLPYTHON:RUN #p"~/example/foo.py") > ? Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > ? To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > ? Run the test suite:??????????????????? (ASDF:OPERATE 'ASDF:TEST-OP :CLPYTHON) > > (:CLPYTHON) > > * (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > ;; The mixed Lisp/Python syntax mode is now active: custom *readtable* is set. > ? ;; Python variables will be interned in the #. > ? ;; To exit the mixed mode: (CLPYTHON.PARSER:EXIT-MIXED-LISP-PYTHON-SYNTAX) > * (+ 2 3) > > 5 > * def double (n): > ??? return 2*n > > # > * double (4) > > 8 > * (double 4) > > ; in: DOUBLE 4 > ;???? (DOUBLE 4) > ; > ; caught STYLE-WARNING: > ;?? undefined function: DOUBLE > ; > ; compilation unit finished > ;?? Undefined function: > ;???? DOUBLE > ;?? caught 1 STYLE-WARNING condition > > debugger invoked on a UNDEFINED-FUNCTION in thread # ???????????????????????????????????????????????????? "initial thread" RUNNING > ???????????????????????????????????????????????????? {1002980D01}>: > ? The function SB-ALIEN:DOUBLE is undefined. > > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. > > restarts (invokable by number or by possibly-abbreviated name): > ? 0: [ABORT] Exit debugger, returning to top level. > > (SB-KERNEL::UNDEFINED-FUN-ERROR-HANDLER > ?# > ?#.(SB-SYS:INT-SAP #X7FFFF69F7480) > ?# ???????????????????????????????????????????????????????????? (STRUCT > ????????????????????????????????????????????????????????????? SB-VM::OS-CONTEXT-T-STRUCT))> > ?(21)) > 0] 0 > > * > -------------------------------------------------------------------------------- > > The evaluation of "(double 4)" fails. > > ################################################################################ > > There is also a problem with python repl: > ? > ; SLIME 2011-01-28 > CL-USER> (ql:quickload :clpython) > To load "clpython": > ? Load 1 ASDF system: > ??? clpython > ; Loading "clpython" > ......... > CLPython quick start guide: > ? Run a string of Python code:?????????? (CLPYTHON:RUN "for i in range(4): print i") > ? Run a Python file:???????????????????? (CLPYTHON:RUN #p"~/example/foo.py") > ? Start the Python "interpreter" (REPL): (CLPYTHON.APP.REPL:REPL) > ? To start mixed Python/Lisp input mode: (CLPYTHON.PARSER:ENTER-MIXED-LISP-PYTHON-SYNTAX) > ? Run the test suite:??????????????????? (ASDF:OPERATE 'ASDF:TEST-OP > ?????????????????????????????????????????????????????? :CLPYTHON) > > > (:CLPYTHON) > CL-USER> (push "/usr/lib/python2.7" *clpython-module-search-paths*) > ("/usr/lib/python2.7") > > CL-USER> (clpython:repl) > Welcome to CLPython, an implementation of Python in Common Lisp. > Running on: SBCL 1.0.47 > REPL shortcuts: `:q' = quit, `:h' = help. > Using 1 default module search paths set in *CLPYTHON-MODULE-SEARCH-PATHS* > >>> import os > ;; Parsing #P"/usr/lib/python2.7/os.py" into #P"/usr/lib/python2.7/os.py.lisp" > > ;; Error occured while reading input with the Python readtable: > ;;?? UnexpectedEofError: Unexpected end of file (line 752). > ;; Standard IO syntax (*readtable* etc) has been activated to enable debugging. > > --- Debugger window ---------------------------------- > UnexpectedEofError: Unexpected end of file (line 752). > ?? [Condition of type CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] > > Restarts: > ?0: [RETRY] Retry evaluating this top-level form in module `__main__' > ?1: [ERROR] Skip this top-level form in module `__main__' > ?2: [RETRY-REPL-EVAL] Retry the expression: "import os" > ?3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level > ?4: [RETRY] Retry SLIME REPL evaluation request. > ?5: [*ABORT] Return to SLIME's top level. > ?--more-- > ? > ? > Just for testing purpose I have commented the following code block in os.py > ? > ----------------------------------------------- > ..... > 742 if not _exists("urandom"): > 743???? def urandom(n): > 744???????? """urandom(n) -> str > 745 > 746???????? Return a string of n random bytes suitable for cryptographic use. > 747 > 748???????? """ > 749???????? try: > 750???????????? _urandomfd = open("/dev/urandom", O_RDONLY) > 751??????? except (OSError, IOError): > 752???????????? raise NotImplementedError("/dev/urandom (or equivalent) not found") > 753???????? try: > 754???????????? bs = b"" > 755???????????? while n > len(bs): > 756???????????????? bs += read(_urandomfd, n - len(bs)) > 757???????? finally: > 758???????????? close(_urandomfd) > 759???????? return bs > ------------------------------------------------- > > and tried the "import os" again and got the same error: > > --- Debugger window ---------------------------------- > UnexpectedEofError: Unexpected end of file. > ?? [Condition of type CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|UnexpectedEofError|] > > Restarts: > ?0: [RETRY] Retry evaluating this top-level form in module `__main__' > ?1: [ERROR] Skip this top-level form in module `__main__' > ?2: [RETRY-REPL-EVAL] Retry the expression: "import os" > ?3: [RETURN-PYTHON-TOPLEVEL] Return to Python top level > ?4: [RETRY] Retry SLIME REPL evaluation request. > ?5: [*ABORT] Return to SLIME's top level. > ?--more-- > > > The situation under Clozure is even worse! The mixed interpreter doesn't work > neither in SLIME nor directly in linux console.The python repl behaviour is > similar to that of SBCL. > > I'm using Clozure 1.6-r14468M and SBCL 1.0.47 on Linux 64bit. > The installed version of clpython ist "clpython-20110219-git". > > Are these known issues or am I missing something here? > > Any feedback is very much appreciated! > > Regards > Nik > > > ? > ? > > > _______________________________________________ > clpython-devel mailing list > clpython-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/clpython-devel > > > >