handle db result stream
python3 hex encoding fix