From dev-return-71882-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Jul 27 09:41:56 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 580B8180657 for ; Fri, 27 Jul 2018 09:41:56 +0200 (CEST) Received: (qmail 53946 invoked by uid 500); 27 Jul 2018 07:41:55 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 53935 invoked by uid 99); 27 Jul 2018 07:41:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2018 07:41:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5A353DFAD2; Fri, 27 Jul 2018 07:41:54 +0000 (UTC) From: lordofkey To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org Message-ID: Subject: [GitHub] zookeeper pull request #586: Zookeeper 3105:Character coding problem occur w... Content-Type: text/plain Date: Fri, 27 Jul 2018 07:41:54 +0000 (UTC) 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 ---- ---