python buffer variable related bug fixed