args = ['--resign', '--define', '_signature gpg', '--define', '_gpg_name ' + sign_key] + files
child = pexpect.spawn('/bin/rpm', args, encoding='utf-8')
child.logfile_read = sys.stderr
- child.expect('Enter pass phrase:', timeout=30)
+ child.expect(u'Enter pass phrase:', timeout=30)
child.sendline(password)
child.expect(pexpect.EOF, timeout=None)
child.close()