cl-python icon indicating copy to clipboard operation
cl-python copied to clipboard

importing library types fails

Open futuro opened this issue 12 years ago • 2 comments

When attempting to load the library bdb, it fails with the following error

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION CLPYTHON::PY-FUNCTION-CODE (1)>
when called with arguments
  (#<FUNCTION # {10100EF89B}>).
   [Condition of type SIMPLE-ERROR]

After loading the latest HEAD from github with ql:quickload (by placing the repo in ~/quicklisp/local-projects), I run the following to produce this error

CL-USER> (clpython.app.repl:repl)
Welcome to CLPython, an implementation of Python in Common Lisp.
Running on: SBCL 1.1.2.35-2b29a7c
REPL shortcuts: `:q' = quit, `:h' = help.

;; Consider customizing variable *CLPYTHON-MODULE-SEARCH-PATHS*
;; to be a list of paths that are tried when locating a module in order to import it
;; (in addition to the current directory and `sys.path'). Typically it should at least
;; contain the path to the Python (2.5) standard libraries, as those are not
;; distributed with CLPython.
>>> import sys
#<module SYS (package "CLPYTHON.MODULE.SYS" with 41 external symbols) {10044C1113}>
>>> print sys.path
[.]
>>> sys.path = ['/usr/lib/python2.7/']

[/usr/lib/python2.7/]
>>> import bdb
;; Parsing #P"/usr/lib/python2.7/bdb.py" into #P"/tmp/clpython-bdb-lisp-58ac5use"
;; Parsing #P"/usr/lib/python2.7/fnmatch.py" into #P"/tmp/clpython-fnmatch-lisp-gfao9rlf"
;; Parsing #P"/usr/lib/python2.7/os.py" into #P"/tmp/clpython-os-lisp-bcztmntz"
;; Parsing #P"/usr/lib/python2.7/posixpath.py" into #P"/tmp/clpython-posixpath-lisp-v3d8ocj1"
;; Parsing #P"/usr/lib/python2.7/stat.py" into #P"/tmp/clpython-stat-lisp-hm7j90p1"
;; Parsing #P"/usr/lib/python2.7/genericpath.py" into #P"/tmp/clpython-genericpath-lisp-uiuj8gke"
;; Parsing #P"/usr/lib/python2.7/warnings.py" into #P"/tmp/clpython-warnings-lisp-u1dmflid"
;; Parsing #P"/usr/lib/python2.7/linecache.py" into #P"/tmp/clpython-linecache-lisp-qjgoy79x"
;; Parsing #P"/usr/lib/python2.7/types.py" into #P"/tmp/clpython-types-lisp-2mfjlxbg"

Let me know if there's any other information I can provide to help with this.

futuro avatar Jan 12 '13 21:01 futuro

The two files, types.py and the temp file created are in the following gist https://gist.github.com/4520580

futuro avatar Jan 12 '13 21:01 futuro

That particular error has now been fixed (c243e529dd91ebbd871da42aad29dd5e55532f84). I know there are more issues while importing types or bdb - I'm working on getting the standard library to import fine.

metawilm avatar Jan 16 '13 17:01 metawilm