-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
TypeError: a bytes-like object is required (ansible_modlib.zip/ansible/module_utils/basic.py) #17038
Comments
False alarm. For future reference: it is a symptom of using Python 3 on the target host. My inventory variables weren't properly loaded and it defaulted to python3. Makes sure to use |
Sorry but this is a valid py3 compatibility bug and should not be closed just because there is a workaround for it.
|
@ssbarnea I'm not sure what are the target goals at the moment for Ansible to decide that, so I'll reopen and let project members decide. |
Thank you. I will make a PR, usually py3 bugs can easily be fixed, the only problem is their number. |
many py3 compatibility fixes have gone into Ansible 2.2, can you confirm this is still an issue in that or devel? |
2.2.0 is where we got far enough into porting that we expect things to work. So if it fails on 2.2 or devel we'd look at fixing it there. |
Here is a clear py3 compatibility bug that I hit https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/core.py#L207 -- |
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Taking a look at the various problems reported in this bug:
The splitter problem... If it's still happening in 2.2 or devel I think we should open a separate bug for it. A reproducer and a complete traceback would help enormously. I've just looked at the code and the text/bytes conversions don't make complete sense to me. Having the traceback and reproducer will let me figure out what is triggering this and I can talk to jimi about whether there's a reason the code is currently doing doing things the way it is. |
@anisse, if you'd like to reach out to me (abadger1999) on irc.freenode.net I'd be happy to look at fixes that should be cherry-picked. I do see that 19569 wasn't cherry-picked to stable-2.2 so I've cherry-picked it now in case we have another 2.2.x release. Note that #19930 is won't fix because it is an incompatibility with python-3.4 and should work fine with python-3.5. We only support python-3.5 and greater which should be of help to most (but unfortunately not all) of what people are using in the wild. |
Sorry to hijack this closed thread, but I'm still having this issue when using
For reference, my setup:
|
@greggilbert Please open a new issue for the following reasons:
|
ISSUE TYPE
COMPONENT NAME
General Ansible / no idea
ANSIBLE VERSION
CONFIGURATION
None
OS / ENVIRONMENT
Plain install of Ansible Tower on CentOS 7, up to date
SUMMARY
TypeError in ansible-generated script
STEPS TO REPRODUCE
EXPECTED RESULTS
Works when run manually on Ansible 2.1.1.0
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: