[GitHub] zookeeper issue #586: Zookeeper 3105:Character coding problem occur when cre...
Github user lordofkey commented on the issue: https://github.com/apache/zookeeper/pull/586 utf-8 encoding is now implemented before passed to a char pointer. ---
[GitHub] zookeeper pull request #586: Zookeeper 3105:Character coding problem occur w...
Github user lordofkey commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/586#discussion_r207772138 --- Diff: src/contrib/zkpython/src/c/zookeeper.c --- @@ -387,8 +387,8 @@ int parse_acls(struct ACL_vector *acls, PyObject *pyacls) PyObject *perms = PyDict_GetItemString( a, "perms" ); #if PY_MAJOR_VERSION >= 3 acls->data[i].perms = (int32_t)(PyLong_AsLong(perms)); -acls->data[i].id.id = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "id" ) ) ); -acls->data[i].id.scheme = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "scheme" ) ) ); +acls->data[i].id.id = strdup( PyBytes_AS_STRING( PyUnicode_AsASCIIString( PyDict_GetItemString( a, "id" ) ) ) ); --- End diff -- i thought the value of id can be "anyone" or ip or the string like "usrname:password", either of them can be represented as a string. then i tried "anyone", "127.0.0.1/16" and "usrname:password", and they all worked. ---
[GitHub] zookeeper pull request #586: Zookeeper 3105:Character coding problem occur w...
GitHub user lordofkey opened a pull request: https://github.com/apache/zookeeper/pull/586 Zookeeper 3105:Character coding problem occur when create a node using python3 when creating a node using python3, InvalidACLException occurs all the time. it`s caused by imcompatible way of parsing acl passed through python3 api. so ``` acls->data[i].id.id = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "id" ) ) ); acls->data[i].id.scheme = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "scheme" ) ) ); ``` is changed to ``` acls->data[i].id.id = strdup( PyBytes_AS_STRING( PyUnicode_AsASCIIString( PyDict_GetItemString( a, "id" ) ) ) ); acls->data[i].id.scheme = strdup( PyBytes_AS_STRING( PyUnicode_AsASCIIString( PyDict_GetItemString( a, "scheme" ) ) ) ); ``` because `acls->data[i].id.id` and `acls->data[i].id.scheme` must be an ASCII string. You can merge this pull request into a Git repository by running: $ git pull https://github.com/lordofkey/zookeeper ZOOKEEPER-3105 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zookeeper/pull/586.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #586 commit 5a441ed6058740458b8ec549fd32931757ce4e3a Author: yanghao Date: 2018-07-27T07:35:41Z ZOOKEEPER-3105:Character coding problem occur when create a node using python3 ---
[GitHub] zookeeper pull request #585: Zookeeper 3105:Character coding problem occur w...
Github user lordofkey closed the pull request at: https://github.com/apache/zookeeper/pull/585 ---
[GitHub] zookeeper pull request #585: Zookeeper 3105:Character coding problem occur w...
GitHub user lordofkey opened a pull request: https://github.com/apache/zookeeper/pull/585 Zookeeper 3105:Character coding problem occur when create a node using python3 when creating a node using python3, InvalidACLException occurs all the time. it`s caused by imcompatible way of parsing acl passed through python3 api. so ``` acls->data[i].id.id = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "id" ) ) ); acls->data[i].id.scheme = strdup( PyUnicode_AsUnicode( PyDict_GetItemString( a, "scheme" ) ) ); ``` is changed to ``` acls->data[i].id.id = strdup( PyBytes_AS_STRING( PyUnicode_AsASCIIString( PyDict_GetItemString( a, "id" ) ) ) ); acls->data[i].id.scheme = strdup( PyBytes_AS_STRING( PyUnicode_AsASCIIString( PyDict_GetItemString( a, "scheme" ) ) ) ); ``` because `acls->data[i].id.id` and `acls->data[i].id.scheme` must be an ASCII string. You can merge this pull request into a Git repository by running: $ git pull https://github.com/lordofkey/zookeeper ZOOKEEPER-3105 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zookeeper/pull/585.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #585 commit e3e68b1d4ffaf1409e74a31eb3365ce20ff956a0 Author: Patrick D. Hunt Date: 2016-03-11T06:34:35Z ZOOKEEPER-2133 zkperl: Segmentation fault if getting a node with null value (Botond Hejj via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1734499 13f79535-47bb-0310-9956-ffa450edef68 commit 3767a3fe7334d2d9aeae31b37442c3bb18ebc7eb Author: Patrick D. Hunt Date: 2016-03-11T06:48:20Z Added some CHANGES details that I missed in recent commits. (phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1734502 13f79535-47bb-0310-9956-ffa450edef68 commit 047936e69ef17b287588a79d0cdedf4d4fd1bffb Author: Patrick D. Hunt Date: 2016-03-14T06:57:10Z ZOOKEEPER-2283 traceFile property is not used in the ZooKeeper, it should be removed from documentation (Arshad Mohammad via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1734882 13f79535-47bb-0310-9956-ffa450edef68 commit a7ceba25e34b61fbfa4efa79283c0d3196998272 Author: Patrick D. Hunt Date: 2016-03-15T16:05:11Z ZOOKEEPER-2385 Zookeeper trunk build is failing on windows (Arshad Mohammad via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735121 13f79535-47bb-0310-9956-ffa450edef68 commit 8e805005359766c52ef87d964de87696163f1a60 Author: Patrick D. Hunt Date: 2016-03-17T06:14:29Z ZOOKEEPER-2388 Unit tests failing on Solaris (Arshad Mohammad via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735370 13f79535-47bb-0310-9956-ffa450edef68 commit 0e7e076abbe70a87e31a62d98e21140d6da0a7f5 Author: Patrick D. Hunt Date: 2016-03-18T17:23:04Z ZOOKEEPER-2392 Update netty to 3.7.1.Final (Hendy Irawan via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735648 13f79535-47bb-0310-9956-ffa450edef68 commit 1b36ea943e209cc76b6930eb90b394958eb19a65 Author: Chris Nauroth Date: 2016-03-19T21:51:14Z ZOOKEEPER-2393: Revert run-time dependency on log4j and slf4j-log4j12 (Arshad Mohammad via cnauroth) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735822 13f79535-47bb-0310-9956-ffa450edef68 commit 6de6e6c74e9f3492601f1d771f9e248555e47a02 Author: Patrick D. Hunt Date: 2016-03-20T04:28:02Z ZOOKEEPER-2240 Make the three-node minimum more explicit in documentation and on website (Shawn Heisey and Arshad Mohammad via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735837 13f79535-47bb-0310-9956-ffa450edef68 commit adcf1469a0851b09a3bd92a9657c9a49efb4ce68 Author: Patrick D. Hunt Date: 2016-03-20T18:34:57Z ZOOKEEPER-2195 fsync.warningthresholdms in zoo.cfg not working (Biju Nair via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1735893 13f79535-47bb-0310-9956-ffa450edef68 commit 8d8090f3274733db90e55c9412294ae02095ec4d Author: Chris Nauroth Date: 2016-03-21T20:45:37Z ZOOKEEPER-2364: "ant docs" fails on branch-3.5 due to missing releasenotes.xml. (phunt via cnauroth) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.5@1736093 13f79535-47bb-0310-9956-ffa450edef68 commit f2c863e8b026109732bf19d662ee91956f05ab5b Author: Camille Fournier Date: 2016-03-22T23:36:42Z ZOOKEEPER-2141. ACL cache in DataTree never removes entries (Adam Milne-Smith via camille) git-svn-id: https://svn.