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.

Author: lordofkey <yyyhhh125@163.com>
Author: yanghao <yyyhhh125@163.com>

Reviewers: phunt@apache.org

Closes #586 from lordofkey/ZOOKEEPER-3105 and squashes the following commits:

24a60d982 [lordofkey] Update zookeeper.c
9f2fd54ca [lordofkey] ZOOKEEPER-3105:Character coding problem occur when create a node usin… …
519a7805f [lordofkey] Merge remote-tracking branch 'shared/master' into HEAD
5a441ed60 [yanghao] ZOOKEEPER-3105:Character coding problem occur when create a node using python3

Change-Id: I72c104edc4c77159f75db1211fcd62b33c7d33d6
(cherry picked from commit 52dcf72b0a035116f83431e30c7acf7301982a28)
Signed-off-by: Patrick Hunt <phunt@apache.org>
1 file changed
tree: cabdfbd91903ef4d3e35ee537872e98165a23538
  1. bin/
  2. conf/
  3. src/
  4. zookeeper-client/
  5. zookeeper-contrib/
  6. zookeeper-docs/
  7. zookeeper-it/
  8. zookeeper-jute/
  9. zookeeper-recipes/
  10. zookeeper-server/
  11. .gitattributes
  12. .gitignore
  13. .travis.yml
  14. build.xml
  15. excludeFindBugsFilter.xml
  16. ivy.xml
  17. ivysettings.xml
  18. LICENSE.txt
  19. NOTICE.txt
  20. owaspSuppressions.xml
  21. pom.xml
  22. README.md
  23. README_packaging.txt
  24. source-package.xml
README.md

For the latest information about ZooKeeper, please visit our website at:

http://zookeeper.apache.org/

and our wiki, at:

https://cwiki.apache.org/confluence/display/ZOOKEEPER

Full documentation for this release can also be found in docs/index.html


Packaging/release artifacts - Maven

A buildable tarball is located under zookeeper/target/ directory

The artifacts for the modules are uploaded to maven central.

Packaging/release artifacts - Ant

The release artifact contains the following jar file at the toplevel:

zookeeper-.jar - legacy jar file which contains all classes and source files. Prior to version 3.3.0 this was the only jar file available. It has the benefit of having the source included (for debugging purposes) however is also larger as a result

The release artifact contains the following jar files in “dist-maven” directory:

zookeeper-.jar - bin (binary) jar - contains only class (.class) files zookeeper--sources.jar - contains only src (.java) files zookeeper--javadoc.jar - contains only javadoc files

These bin/src/javadoc jars were added specifically to support Maven/Ivy which have the ability to pull these down automatically as part of your build process. The content of the legacy jar and the bin+sources jar are the same.

As of version 3.3.0 bin/sources/javadoc jars contained in dist-maven directory are deployed to the Apache Maven repository after the release has been accepted by Apache: http://people.apache.org/repo/m2-ibiblio-rsync-repository/