Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

AttributeError: 'module' object has no attribute 'path' when compiling pyjamas-0.8a1 examples #46

Open
pyjsorg opened this Issue · 5 comments

1 participant

pyjs.org
pyjs.org
Owner

What steps will reproduce the problem?

  1. Installed pyjamas-0.7 to ~/tmp/pyjamas-0.7/ from pypi tgz package. Built the 'examples' directory without issues and browsed example gallery using localhost. So far so good.
  2. Installed pyjamas-0.8a1
  3. tried to build the 'examples' directory by doing cd examples && python .

What is the expected output? What do you see instead?

Expected: pyjamas-0.7 like example output with a short compilation OK message. Instead I get an AttributeError from translating sys.py (see attached)

Environment:

Mac OS X Snow Leopard 10.6.8 Intel/i386 running python-2.7.2 from macports. Problem also happens in python-2.6.7 from macports package.

Additional info:

I'm a newbie to pyjamas but have expert knowledge of python and other stuff. I was expecting my first git clone to work out of the box instead of having to fall back to 0.7. Maybe someone could point this out in the tutorial (if the problem's not my system).

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=677 (January 11, 2012 18:44:50)

pyjs.org
Owner

From yangofz...@gmail.com on January 12, 2012 23:14:15:
OK - 35e802c
bad - 271a8aa

Note: git clone before checkout or else some stale *.pyc or cached files may not cause this problem to appear.

pyjs.org
Owner

From yangofz...@gmail.com on January 13, 2012 00:01:23:
$ git show 271a8aa
commit 271a8aa
Author: Kees Bos kbos@ems-dev.kbo.zx.nl
Date: Thu Mar 3 15:30:35 2011 +0100

Fix from  issue #556  : CanvasProcessing.py does not compile
Thanks to Gabriel Jacobo

diff --git a/pyjs/src/pyjs/linker.py b/pyjs/src/pyjs/linker.py
index 2cbe44a..4b8ea48 100644
--- a/pyjs/src/pyjs/linker.py
+++ b/pyjs/src/pyjs/linker.py
@@ -107,7 +107,7 @@ def out_translate(platform, file_names, out_file, module_name,
opts = ["--module-name", module_name,
"-o", out_file.replace(" ", r"\ "),
] + get_translator_opts(translator_args) + file_names

  • opts = [pyjs.PYTHON] + ['translator.py'] + opts
  • opts = [pyjs.PYTHON] + [os.path.join(pydir, 'translator.py')] + opts pyjscompile_cmd = ' '.join(opts) #print pyjscompile_cmd - use this to create Makefile code-fragment proc = subprocess.Popen(pyjscompile_cmd, @@ -115,7 +115,7 @@ def out_translate(platform, file_names, out_file, module_name, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True,
  • cwd=pydir,
  • cwd=os.path.dirname(file_names[0]), env=os.environ ) stdout_value, stderr_value = proc.communicate('') diff --git a/pyjs/src/pyjs/translator.py b/pyjs/src/pyjs/translator.py index fca86ed..2469ea6 100644 --- a/pyjs/src/pyjs/translator.py +++ b/pyjs/src/pyjs/translator.py @@ -524,7 +524,7 @@ class Pyjamas(object): data = open(node.args[0].value, 'r').read() except IOError, e: raise TranslationError(
  • "Cannot include file '%s': %s" % (node.args[0].value, e))
  • "Cannot include file '%s': %s" % (node.args[0].value, e), node.node) translator.ignore_debug = True return data, False else:
pyjs.org
Owner

From yangofz...@gmail.com on January 13, 2012 00:04:52:
This line is causing the error:

  • "Cannot include file '%s': %s" % (node.args[0].value, e))
  • "Cannot include file '%s': %s" % (node.args[0].value, e), node.node)
pyjs.org
Owner

From yangofz...@gmail.com on January 13, 2012 01:23:42:
Using the compiler from 35e802c avoids the error, but then there's other errors during Translation.

pyjs.org
Owner

From cornelis...@gmail.com on January 13, 2012 12:58:44:
What I don't onderstand (from the first log) is
{{{
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 80, in makepath
dir = os.path.join(*paths)
AttributeError: 'module' object has no attribute 'path'
}}}
How can the 'os' module not have 'path', while at the top of the file os.path is used without throwing errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.