From 8d99512e14189b9fc7bd23ecf97fab8d37bb65e2 Mon Sep 17 00:00:00 2001 From: Javier Cacheiro Date: Tue, 26 Oct 2021 17:14:15 +0200 Subject: [PATCH] doc: data must be a byte string Data must be a byte string in python 3. Signed-off-by: Javier Cacheiro --- doc/rbd/api/librbdpy.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.5