-
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
Blockinfile: insert[before|after] throws: cannot use a string pattern on a bytes-like object #26793
Labels
affects_2.3
This issue/PR affects Ansible v2.3
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Comments
ansibot
added
affects_2.3
This issue/PR affects Ansible v2.3
bug_report
module
This issue/PR relates to a module.
needs_triage
Needs a first human triage before being processed.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
labels
Jul 14, 2017
Tux12Fun
changed the title
Blockinfile: insert[before|after] throws:
Blockinfile: insert[before|after] throws: cannot use a string pattern on a bytes-like object
Jul 14, 2017
jctanner
removed
the
needs_triage
Needs a first human triage before being processed.
label
Jul 14, 2017
In my case, I fix same problem using to_bytes() instead of b().
|
@smellman Your solution worked for me. Thanks. |
Affects me as well on current I've used similar Going to make a PR to do the same in |
bak1an
added a commit
to bak1an/ansible
that referenced
this issue
Sep 8, 2017
abadger
pushed a commit
that referenced
this issue
Sep 9, 2017
Akasurde
pushed a commit
to Akasurde/ansible
that referenced
this issue
Sep 10, 2017
prasadkatti
pushed a commit
to prasadkatti/ansible
that referenced
this issue
Oct 1, 2017
BondAnthony
pushed a commit
to BondAnthony/ansible
that referenced
this issue
Oct 5, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.3
This issue/PR affects Ansible v2.3
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
blockinfile.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
OS: Ubuntu 16.04 Xenial with Python3 (interpreter is set to Python3)
SUMMARY
Python3 changes the behavior for the search function as it seams.
STEPS TO REPRODUCE
Only affects insertbefore / insertafter
EXPECTED RESULTS
No error should occur. We are only replacing in a ASCII file a part.
ACTUAL RESULTS
Module crash
BUGFIX
Caution, a developer should verify this, because I'am not firm with Python at all.
Neither with Python 2 / Python 3 differencees
The text was updated successfully, but these errors were encountered: