Skip to content

keytab.py python 3.x support #2

Description

@jpalko

I tried running this with a python 3.6 virtualenv on a CentOS 7 system having python 2.7 and 3.6 installed.

I ran into the problem with updating a previously made ktutil keytab file that using this code ended with:

(keytab) [user@host ~]$ python keytab.py --update user --domain=REALM --keytab=user.keytab 
Traceback (most recent call last):
  File "keytab.py", line 110, in <module>
    wait()
  File "keytab.py", line 101, in wait
    lines = child.before.strip().split('\n').decode()
TypeError: a bytes-like object is required, not 'str'

I modified line 101 from
lines = child.before.strip().split('\n')
to
lines = child.before.strip().decode().split('\n')
which helped the code to work.

Anyway, this little bit of python was helpful for myself, so thanks. :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions