zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From breed <...@git.apache.org>
Subject [GitHub] zookeeper pull request #586: Zookeeper 3105:Character coding problem occur w...
Date Fri, 03 Aug 2018 16:28:48 GMT
Github user breed commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/586#discussion_r207599621
  
    --- 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 --
    
    this only works for ascii strings. that should be ok for scheme, but maybe not for id.


---

Mime
View raw message