IBM-Security / isam-ansible-roles

DEPRECATED Ansible Custom Modules, Handlers and Tasks for ISAM. Requires "ibmsecurity" python package.
Apache License 2.0
24 stars 43 forks source link

Compatible import for StringIO #168

Closed sygilber closed 4 years ago

sygilber commented 4 years ago

@Ram this should resolve compatibility issue for both Python. However, I only tested with Python V2.X. Thanks

ram-ibm commented 4 years ago

Any chance you have documentation that explains how to handle StringIO between python 2 and 3 please? Also you may want to consider moving to python3 since there will be no more fixes coming for python2 end of the year.

sygilber commented 4 years ago

@ram-ibm I had identified this thread indicating how to support Python V2 & V3:

https://stackoverflow.com/questions/11914472/stringio-in-python3

The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.

I tested this code fix on Python V3.6 as well lately.