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

ansible-test yamllint: fix UnicodeDecodeError #55364

Merged

Conversation

Projects
None yet
3 participants
@mkrizek
Copy link
Contributor

mkrizek commented Apr 16, 2019

SUMMARY

This fixes the below traceback (triggered by test/integration/targets/vault/vault-café.yml) on Python 2:

$ ansible-test sanity --test yamllint
Sanity check using yamllint

NOTICE: Killed command to avoid an orphaned child process during handling of an unexpected exception.
Traceback (most recent call last):
  File "/home/mkrizek/src/ansible/bin/ansible-test", line 15, in <module>
    lib.cli.main()
  File "/home/mkrizek/src/ansible/test/runner/lib/cli.py", line 108, in main
    args.func(config)
  File "/home/mkrizek/src/ansible/test/runner/lib/sanity/__init__.py", line 113, in command_sanity
    result = test.test(args, targets)
  File "/home/mkrizek/src/ansible/test/runner/lib/sanity/yamllint.py", line 58, in test
    results += self.test_paths(args, test_paths)
  File "/home/mkrizek/src/ansible/test/runner/lib/sanity/yamllint.py", line 82, in test_paths
    stdout, stderr = run_command(args, cmd, data=data, capture=True)
  File "/home/mkrizek/src/ansible/test/runner/lib/util.py", line 366, in run_command
    cmd_verbosity=cmd_verbosity, str_errors=str_errors)
  File "/home/mkrizek/src/ansible/test/runner/lib/util.py", line 443, in raw_command
    data_bytes = data.encode(encoding, 'surrogateescape') if data else None
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 230711: ordinal not in range(128)
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

test/runner/lib/util.py

@mkrizek mkrizek requested a review from mattclay Apr 16, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Apr 16, 2019

Show resolved Hide resolved test/runner/lib/util.py Outdated

@mattclay mattclay removed the needs_triage label Apr 16, 2019

@mattclay

This comment has been minimized.

Copy link
Member

mattclay commented Apr 16, 2019

@mkrizek Once this is merged it should be backported to the stable branches for 2.6 - 2.8.

@ansibot ansibot added needs_revision and removed core_review labels Apr 16, 2019

@mkrizek mkrizek merged commit f8bebc6 into ansible:devel Apr 17, 2019

1 check passed

Shippable Run 119580 status is SUCCESS.
Details

@mkrizek mkrizek deleted the mkrizek:ansible-test-sanity-yamllint-unicodeerror branch Apr 17, 2019

mkrizek added a commit to mkrizek/ansible that referenced this pull request Apr 17, 2019

ansible-test yamllint: fix UnicodeDecodeError (ansible#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)

mkrizek added a commit to mkrizek/ansible that referenced this pull request Apr 17, 2019

ansible-test yamllint: fix UnicodeDecodeError (ansible#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)

mkrizek added a commit to mkrizek/ansible that referenced this pull request Apr 17, 2019

ansible-test yamllint: fix UnicodeDecodeError (ansible#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)
@mkrizek

This comment has been minimized.

Copy link
Contributor Author

mkrizek commented Apr 17, 2019

@mattclay Backports created.

ruimoreira added a commit to ruimoreira/ansible that referenced this pull request Apr 22, 2019

ansible-test yamllint: fix UnicodeDecodeError (ansible#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

mattclay added a commit that referenced this pull request Apr 22, 2019

ansible-test yamllint: fix UnicodeDecodeError (#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)

mattclay added a commit that referenced this pull request Apr 22, 2019

ansible-test yamllint: fix UnicodeDecodeError (#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)

mattclay added a commit that referenced this pull request Apr 22, 2019

ansible-test yamllint: fix UnicodeDecodeError (#55364)
* ansible-test yamllint: fix UnicodeDecodeError

* Conditional fix

(cherry picked from commit f8bebc6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.