For Python 3 str is equal to unicode. For Python 2 str is bytes, though, and array.array expects the first argument to be of type str, i.e., bytes for PY2. Through a simple wrapper with str (typecode) ...
The changes introduced by this ticket in python/cpython@9fc720e#r45794801 are problematic. I discovered this from having tests failing when testing on Python 3.7 and up The bug is that calling ...