You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "TuxRacer (JIRA)" <ji...@apache.org> on 2010/09/22 12:44:33 UTC

[jira] Created: (ZOOKEEPER-877) zkpython does not work with python3.1

zkpython does not work with python3.1
-------------------------------------

                 Key: ZOOKEEPER-877
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
             Project: Zookeeper
          Issue Type: Bug
          Components: contrib-bindings
         Environment: linux+python3.1
            Reporter: TuxRacer
             Fix For: 3.3.1


as written in the contrib/zkpython/README file:


"Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."

this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:


python3.1
Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import zookeeper
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString



are there any plan to support Python3.X?

I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

TuxRacer updated ZOOKEEPER-877:
-------------------------------

    Attachment: Doc.tgz
                zookeeper.rst

Adding also a documentation file zookeeper.rst in RST format (standard documentation format for python).
The information has been taken from the ./src/c/pyzk_docstrings.h file.
Attaching the Doc environment in Doc.tgz

To build it just run:

sphinx-build Doc html

It is in theory possible to generate an HTML doc directly from the C docstrings but almost impossible to get a nice HTML ouput.



> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: Doc.tgz, tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1, zookeeper.c.patch.v2, zookeeper.c.v2, zookeeper.rst
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915817#action_12915817 ] 

TuxRacer commented on ZOOKEEPER-877:
------------------------------------

the new file streams handling introduced with the above patch should work with both python2.6 and python3.1, so the code could probably be simplified removing the 2.6 conditional compilation preprocessor directive.

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1, zookeeper.c.patch.v2, zookeeper.c.v2
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

TuxRacer updated ZOOKEEPER-877:
-------------------------------

    Attachment: zookeeper.c.patch.v1
                zookeeper.c
                tests_py3k.tgz

Please find my first attempt to resolve this issue as three attachments
The zookeeper.c file (full code attached + diff file) now supports a compilation with python3.1 and python2.6.
(I used conditional compilation as recommended at
http://docs.python.org/py3k/howto/cporting.html )

I converted the python test to py3k syntax using the '2to3' tool.
So we probably need to add a 2nd directory in the tree (and call it maybe 'tests_py3k'?)

good news:
all the test pass 

bad news:
I could not make logging work (so had to comment the log setup in the tests)

Please let me know what you think, thanks. TuX


> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

TuxRacer updated ZOOKEEPER-877:
-------------------------------

    Attachment: zookeeper.c.v2
                zookeeper.c.patch.v2

a new version of the C file to also support file streams logs in py3k

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1, zookeeper.c.patch.v2, zookeeper.c.v2
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

TuxRacer updated ZOOKEEPER-877:
-------------------------------

        Fix Version/s:     (was: 3.3.1)
    Affects Version/s: 3.3.1

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-877:
-----------------------------------

    Assignee: TuxRacer

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-877:
-----------------------------------

    Status: Patch Available  (was: Open)

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12930252#action_12930252 ] 

Hadoop QA commented on ZOOKEEPER-877:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12456008/zookeeper.rst
  against trunk revision 1033155.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    -1 patch.  The patch command could not apply the patch.

Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/10//console

This message is automatically generated.

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>            Assignee: TuxRacer
>             Fix For: 3.4.0
>
>         Attachments: Doc.tgz, tests_py3k.tgz, zookeeper.c, zookeeper.c.patch.v1, zookeeper.c.patch.v2, zookeeper.c.v2, zookeeper.rst
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "TuxRacer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914513#action_12914513 ] 

TuxRacer commented on ZOOKEEPER-877:
------------------------------------

In py3k PyString_AsString does not exist

see http://www.velocityreviews.com/forums/t674572-where-is-the-pystring_asstring-in-python-3-0-a.html

There is no PyString_AsString. Everything string is unicode now. (PyUnicode API)

example:

PyString_FromString -> PyUnicode_FromString
PyString_Concat -> PyUnicode_Concat
etc...

To get a char * you have to explicitly encode the string with
PyUnicode_AsEncodedString.


> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>             Fix For: 3.4.0
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-877) zkpython does not work with python3.1

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-877:
-----------------------------------

    Fix Version/s: 3.4.0

Slating for 3.4. This would be a great project for someone interested in both zk and python 3 support. ;-)

> zkpython does not work with python3.1
> -------------------------------------
>
>                 Key: ZOOKEEPER-877
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-877
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bindings
>    Affects Versions: 3.3.1
>         Environment: linux+python3.1
>            Reporter: TuxRacer
>             Fix For: 3.4.0
>
>
> as written in the contrib/zkpython/README file:
> "Python >= 2.6 is required. We have tested against 2.6. We have not tested against 3.x."
> this is probably more a 'new feature' request than a bug; anyway compiling the pythn module and calling it returns an error at load time:
> python3.1
> Python 3.1.2 (r312:79147, May  8 2010, 16:36:46) 
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import zookeeper
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python3.1/dist-packages/zookeeper.so: undefined symbol: PyString_AsString
> are there any plan to support Python3.X?
> I also tried to write a 3.1 ctypes wrapper but the C API seems in fact to be written in C++, so python ctypes cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.