Re: [Qemu-devel] [Qemu-block] [PATCH v2] iotests: handle TypeError for Python3 in test 242

2019-02-26 Thread Andrey Shinkevich
On 26/02/2019 17:06, Eric Blake wrote: > On 2/26/19 4:39 AM, Andrey Shinkevich wrote: > >>> +++ b/tests/qemu-iotests/242 >>> @@ -64,10 +64,12 @@ def write_to_disk(offset, size): >>>  def toggle_flag(offset): >>>      with open(disk, "r+b") as f: >>>          

Re: [Qemu-devel] [Qemu-block] [PATCH v2] iotests: handle TypeError for Python3 in test 242

2019-02-26 Thread Eric Blake
On 2/26/19 4:39 AM, Andrey Shinkevich wrote: >> +++ b/tests/qemu-iotests/242 >> @@ -64,10 +64,12 @@ def write_to_disk(offset, size): >>  def toggle_flag(offset): >>      with open(disk, "r+b") as f: >>          f.seek(offset, 0) >> -        c = f.read(1) >> -       

Re: [Qemu-devel] [Qemu-block] [PATCH v2] iotests: handle TypeError for Python3 in test 242

2019-02-26 Thread Eduardo Habkost
On Tue, Feb 26, 2019 at 03:42:11AM +0200, Nir Soffer wrote: > On Mon, Feb 25, 2019 at 10:36 PM Eduardo Habkost [...] > > -c = f.read(1) > > -toggled = chr(ord(c) ^ bitmap_flag_unknown) > > +# The casts to bytearray() below are only necessary > > +# for Python 2

Re: [Qemu-devel] [Qemu-block] [PATCH v2] iotests: handle TypeError for Python3 in test 242

2019-02-26 Thread Andrey Shinkevich
On 26/02/2019 04:42, Nir Soffer wrote: > On Mon, Feb 25, 2019 at 10:36 PM Eduardo Habkost > wrote: > > On Fri, Feb 22, 2019 at 02:26:13PM +0300, Andrey Shinkevich wrote: > > The data type for bytes in Python3 differs from the one in Python2. > > Those

Re: [Qemu-devel] [Qemu-block] [PATCH v2] iotests: handle TypeError for Python3 in test 242

2019-02-25 Thread Nir Soffer
On Mon, Feb 25, 2019 at 10:36 PM Eduardo Habkost wrote: > On Fri, Feb 22, 2019 at 02:26:13PM +0300, Andrey Shinkevich wrote: > > The data type for bytes in Python3 differs from the one in Python2. > > Those cases should be managed separately. > > > > v1: > > In the first version, the TypeError