1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/units
Marius Gedminas 5d29a2eabd Python 3: shlex.split() wants unicode
On Python 2, shlex.split() raises if you pass it a unicode object with
non-ASCII characters in it.  The Ansible codebase copes by explicitly
converting the string using to_bytes() before passing it to
shlex.split().

On Python 3, shlex.split() raises ('bytes' object has no attribute 'read')
if you pass a bytes object.  Oops.

This commit introduces a new wrapper function, shlex_split, that
transparently performs the to_bytes/to_unicode conversions only on
Python 2.

Currently I've only converted one call site (the one that was causing a
unit test to fail on Python 3).  If this approach is deemed suitable,
I'll convert them all.
2015-09-24 12:36:05 +03:00
..
errors Making the switch to v2 2015-05-03 21:47:26 -05:00
executor Add a comment explaining why async = 1 in the test 2015-09-07 19:46:05 +03:00
inventory Support «hosts: groupname[1:]» notation (~= 'the rest of the group') 2015-09-18 22:28:34 +05:30
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 2015-05-28 15:26:03 -05:00
mock Starting to add additional unit tests for VariableManager 2015-09-04 16:41:38 -04:00
module_utils Use 0oNNN octal syntax in test/ 2015-08-27 22:15:57 +03:00
parsing Allow hexadecimal ranges in IPv6 addresses, not only 0-9 2015-09-17 23:32:58 +05:30
playbook Fix unit tests for change related to local_action 2015-09-14 14:07:17 -04:00
plugins Ported over #7158 to support SELinux context switches. 2015-09-17 15:03:46 +02:00
template corrected all missing paths changes 2015-09-15 11:57:54 -04:00
utils Python 3: shlex.split() wants unicode 2015-09-24 12:36:05 +03:00
vars Properly handle group/host_var files with dots in them 2015-09-08 03:20:09 -04:00
__init__.py Making the switch to v2 2015-05-03 21:47:26 -05:00