brython-dev / brython

Brython (Browser Python) is an implementation of Python 3 running in the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

io.BytesIO returns wrong getvalue() after seeking

LatinSuD opened this issue · comments

getvalue() and getbuffer() return wrong results after having used seek.

This code:

import io

bio = io.BytesIO(bytes('1234', encoding='ascii'))
bio.seek(0)
bio.write(b"HI")
print(bio.getvalue())

In Python returns:
b'HI34'

While in Brython it returns:
b'1234HI'

Thanks for the report @LatinSuD !