You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/03/15 20:40:51 UTC

[GitHub] bjonnh opened a new issue #1395: Python 3 example on the getting started

bjonnh opened a new issue #1395: Python 3 example on the getting started
URL: https://github.com/apache/incubator-pulsar/issues/1395
 
 
   #### Expected behavior
   
   Working "getting-started" guide example.
   
   #### Actual behavior
   
   The script producer script is raising an error:
   Traceback (most recent call last):
     File "pulsar_pub.py", line 7, in <module>
       producer.send('hello-pulsar-%d' % i)
     File "./test/pulsar/venv/lib/python3.6/site-packages/pulsar.py", line 568, in send
       replication_clusters, disable_replication)
     File "./test/pulsar/venv/lib/python3.6/site-packages/pulsar.py", line 629, in _build_msg
       _check_type(bytes, content, 'content')
     File "./test/pulsar/venv/lib/python3.6/site-packages/pulsar.py", line 803, in _check_type
       raise ValueError("Argument %s is expected to be of type '%s'" % (name, var_type.__name__))
   ValueError: Argument content is expected to be of type 'bytes'
   
   
   #### Steps to reproduce
   
   Just try the examples on page: https://pulsar.apache.org/docs/latest/getting-started/docker/
   with Python3.
   
   #### Steps to resolve
   
   From a client side, replaced the send by:
   producer.send(('hello-pulsar-%d' % i).encode('utf8')) 
   
   This should work with python2 too, at least recent versions of it.
   
   #### System configuration
   **Pulsar version**: Docker version 1.22.0-incubating
   **Pulsar-client version**: pulsar-client==1.22.0 (from pip)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services