Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keytab.py python 3.x support #2

Open
jpalko opened this issue Mar 12, 2021 · 1 comment
Open

keytab.py python 3.x support #2

jpalko opened this issue Mar 12, 2021 · 1 comment

Comments

@jpalko
Copy link

jpalko commented Mar 12, 2021

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. :)

@Tagar
Copy link
Owner

Tagar commented Apr 2, 2021

Thanks for letting me know. Feel free to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants