merge of #2531 python 3