Unicode JavaScript Source

84 views
Skip to first unread message

mcot

unread,
Feb 15, 2011, 6:18:50 PM2/15/11
to PyV8
It looks like it is valid to have unicode characters in JavaScript
source code, but the eval command is expecting a std::string it
seems. I got this error when trying to evaluate the code:

Python argument types in
JSContext.eval(JSContext, unicode, str)
did not match C++ signature:
eval(CContext {lvalue}, std::string source, std::string name='',
int line=-1, int col=-1, boost::python::api::object precompiled=None)

mcot

unread,
Feb 15, 2011, 6:25:32 PM2/15/11
to PyV8
So here is what I mean about unicode in JavaScript source:

http://xahlee.org/js/ex/js_unicode.js

(This is part of a test page to see if your JS engine has unicode
support for var/function names).

Flier Lu

unread,
Feb 15, 2011, 9:06:45 PM2/15/11
to PyV8
OK, I have submitted a issue to follow up it

http://code.google.com/p/pyv8/issues/detail?id=75

Flier Lu

unread,
Feb 19, 2011, 12:52:28 AM2/19/11
to PyV8
Now, PyV8 support to compile/execute the Unicode JavaScript Source,
and get/set Unicode attribute from both Python/JavaScript sides.

Please verify it with SVN trunk code after r341, Thanks

On Feb 16, 7:25 am, mcot <atm1...@gmail.com> wrote:

mcot

unread,
Feb 22, 2011, 12:04:18 PM2/22/11
to PyV8
I am getting a runtime error on the latest release (r342)

import _PyV8
ImportError: /usr/local/lib/python2.6/dist-packages/PyV8-1.0-py2.6-
linux-x86_64.egg/_PyV8.so: undefined symbol: _ZN10CPythonGILC1Ev

This is on:
Ubuntu 10.04 x64
gcc 4.4.3

I have tested with v8 r6401, r6902, and r6583.

mcot

unread,
Feb 22, 2011, 11:47:12 AM2/22/11
to PyV8
I am getting a runtime error with the newest release (r342).

import _PyV8
ImportError: /usr/local/lib/python2.6/dist-packages/PyV8-1.0-py2.6-
linux-x86_64.egg/_PyV8.so: undefined symbol: _ZN10CPythonGILC1Ev

I have tested against both v8 r6401 and r6583.

I am running on:
Ubuntu 10.04 x64
gcc 4.4.3


On Feb 19, 12:52 am, Flier Lu <flier...@gmail.com> wrote:

Flier Lu

unread,
Feb 22, 2011, 9:15:03 PM2/22/11
to PyV8
Hi mcot,

Could you try a clean build? I have moved Python::GIL to the
Utils.h/.cpp files, link the old .o files may cause issue.

Angelo Dell'Aera

unread,
Feb 23, 2011, 3:58:20 AM2/23/11
to py...@googlegroups.com
On Tue, 22 Feb 2011 08:47:12 -0800 (PST)
mcot <atm...@gmail.com> wrote:

> I am getting a runtime error with the newest release (r342).
>
> import _PyV8
> ImportError: /usr/local/lib/python2.6/dist-packages/PyV8-1.0-py2.6-
> linux-x86_64.egg/_PyV8.so: undefined symbol: _ZN10CPythonGILC1Ev
>
> I have tested against both v8 r6401 and r6583.
>
> I am running on:
> Ubuntu 10.04 x64
> gcc 4.4.3


No problems at all here.

buffer@alnitak ~/pyv8 $ svn info | grep Revision
Revision: 342
buffer@alnitak ~/pyv8 $ cd
buffer@alnitak ~ $ python
Python 2.6.6 (r266:84292, Feb 14 2011, 10:58:29)
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyV8
>>>


Cheers,


--

Angelo Dell'Aera 'buffer'
Antifork Research, Inc. http://buffer.antifork.org
Metro Olografix

mcot

unread,
Feb 23, 2011, 2:21:12 PM2/23/11
to PyV8
I am still getting the same error even after a clean build.

On Feb 23, 3:58 am, Angelo Dell'Aera <angelo.della...@gmail.com>
wrote:
> On Tue, 22 Feb 2011 08:47:12 -0800 (PST)
>

Flier Lu

unread,
Feb 23, 2011, 10:09:52 PM2/23/11
to PyV8
OK, I will find a machine and try to reproduce it later

Flier Lu

unread,
Feb 24, 2011, 9:18:53 AM2/24/11
to PyV8
I can't reproduce your issue at Ubuntu 10.04 x64, what's version of
your system, GCC and boost?

$ uname -a
Linux domU-12-31-39-04-00-DF 2.6.35-24-virtual #42-Ubuntu SMP Thu Dec
2 05:15:26 UTC 2010 x86_64 GNU/Linux

$ python PyV8.py -v
2011-02-24 14:15:51,893 INFO testing PyV8 module 1.0 with V8 v3.1.6
testBlock (__main__.TestAST) ... ok
...
testWatch (__main__.TestWrapper) ... ok

----------------------------------------------------------------------
Ran 50 tests in 2.087s

OK

$ ldd _PyV8.so
linux-vdso.so.1 => (0x00007fff8efff000)
libboost_python-py26.so.1.42.0 => /usr/lib/libboost_python-
py26.so.1.42.0 (0x00007fab57e31000)
librt.so.1 => /lib/librt.so.1 (0x00007fab57c29000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fab57922000)
libm.so.6 => /lib/libm.so.6 (0x00007fab5769f000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fab57489000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fab5726b000)
libc.so.6 => /lib/libc.so.6 (0x00007fab56ee8000)
libutil.so.1 => /lib/libutil.so.1 (0x00007fab56ce5000)
libdl.so.2 => /lib/libdl.so.2 (0x00007fab56ae0000)
/lib64/ld-linux-x86-64.so.2 (0x00007fab58981000)

$ svn info ../v8
Path: ../v8
URL: http://v8.googlecode.com/svn/trunk
Repository Root: http://v8.googlecode.com/svn
Repository UUID: ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Revision: 6934
Node Kind: directory
Schedule: normal
Last Changed Author: fschn...@chromium.org
Last Changed Rev: 6926
Last Changed Date: 2011-02-24 10:10:44 +0000 (Thu, 24 Feb 2011)

mcot

unread,
Feb 24, 2011, 1:26:53 PM2/24/11
to PyV8
I am on boost 1.40.0, gcc 4.4.3:

$ uname -a
Linux ubuntu 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC
2010 x86_64 GNU/Linux

$ ldd _PyV8.so
linux-vdso.so.1 => (0x00007fff3c7ff000)
libboost_python-py26.so.1.40.0 => /usr/lib/libboost_python-py26.so.
1.40.0 (0x00007f6262abd000)
librt.so.1 => /lib/librt.so.1 (0x00007f62628b5000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f62625a0000)
libm.so.6 => /lib/libm.so.6 (0x00007f626231d000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f6262106000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f6261ee8000)
libc.so.6 => /lib/libc.so.6 (0x00007f6261b65000)
libutil.so.1 => /lib/libutil.so.1 (0x00007f6261962000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f626175d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f62637d1000)
> Last Changed Author: fschnei...@chromium.org

mcot

unread,
Feb 24, 2011, 1:31:46 PM2/24/11
to PyV8
I installed boost via apt:

libboost-python1.40-dev seems to be the latest.
> Last Changed Author: fschnei...@chromium.org

Flier Lu

unread,
Feb 25, 2011, 9:10:39 AM2/25/11
to PyV8
I think the boost version is not the root cause, did you modified some
files in pyv8? Could you check out the whole pyv8 project to a new
folder and try again?

Thanks

mcot

unread,
Feb 25, 2011, 10:56:41 AM2/25/11
to PyV8
I built it on a fresh system and it worked fine. I am not sure what
was up with the old system.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages