Python 3 In Memory Zipfile Error. string argument expected, got ‘bytes’

ZipFile writes its data as bytes, not strings. This means you’ll have to use BytesIO instead of StringIO on Python 3.

The distinction between bytes and strings is new in Python 3. The six compatibility library has a BytesIO class for Python 2 if you want your program to be compatible with both.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)