I'm a newbie trying #pythonchallenge, with some help! I'm in Challenge 8 and a simple command such as:
import bz2
bz2.decompress('BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084')
Won't work in Python 3X (but it does in Python 2x)
A number of times I had to change from bytes.decode into str and vice-versa, but I'm just at a lost when to change and why.
The other example was in Challenge 6
comments = comments + str(bytes.decode((zip_try.getinfo(f_name).comment)))
I keep receiving the message TypeError: 'str' does not support the buffer interface
Any help?
I tried different pages to indicate portability from Python 2X to 3X and they say: 'strings are Unicode by default '
What does it mean? That I actually would not have to inform
bytes('my stuff', 'utf-8')
, right?
Thanks, sorry if it sounds dumb!