From: Javier Cacheiro Date: Tue, 26 Oct 2021 15:14:15 +0000 (+0200) Subject: doc: data must be a byte string X-Git-Tag: v17.1.0~596^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8d99512e14189b9fc7bd23ecf97fab8d37bb65e2;p=ceph.git doc: data must be a byte string Data must be a byte string in python 3. Signed-off-by: Javier Cacheiro --- diff --git a/doc/rbd/api/librbdpy.rst b/doc/rbd/api/librbdpy.rst index dc01f2373ae93..7a74b049828cd 100644 --- a/doc/rbd/api/librbdpy.rst +++ b/doc/rbd/api/librbdpy.rst @@ -29,7 +29,7 @@ image:: To perform I/O on the image, you instantiate an :class:rbd.Image object:: image = rbd.Image(ioctx, 'myimage') - data = 'foo' * 200 + data = b'foo' * 200 image.write(data, 0) This writes 'foo' to the first 600 bytes of the image. Note that data @@ -55,7 +55,7 @@ block:: rbd_inst.create(ioctx, 'myimage', size) image = rbd.Image(ioctx, 'myimage') try: - data = 'foo' * 200 + data = b'foo' * 200 image.write(data, 0) finally: image.close() @@ -75,7 +75,7 @@ above example becomes:: size = 4 * 1024**3 # 4 GiB rbd_inst.create(ioctx, 'myimage', size) with rbd.Image(ioctx, 'myimage') as image: - data = 'foo' * 200 + data = b'foo' * 200 image.write(data, 0) API Reference