title: TypeError: a bytes-like object is required, not 'str' while using kinit.stdin.write('%s\n' % password)
body: <p>I am trying to connect to SQL server from Linux machine using python. However facing an issue while trying to get the kerbos ticket. Below is the code i am using.</p>
  
  <pre><code># Login Credentials
  userid = "username"
  password = "password"
  realm="realm.com"
  kinit = '/usr/bin/kinit'
  
  # Get Fresh Kerberos Ticket
  kinit_args = [ kinit, '%s@%s' % (userid, realm) ]
  kinit = Popen(kinit_args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
  kinit.stdin.write('%s\n' % password)
  kinit.wait()
  
  Error message displayed :
  Traceback (most recent call last):
      File "poc_test1.py", line 25, in &lt;module&gt;
        kinit.stdin.write('%s\n' % password)
  TypeError: a bytes-like object is required, not 'str'
  </code></pre>
  
  <p>Thanks in advance.</p>