fixed error import
added python version check for unicode <-> string exchange.