We are migrating our python project code from py2.7 code to py3.7, as part of migration process code should be compatible with both py27 and py37 versions.
to become compatible with both the version we are using six library. Here I could see an unexpected behaviour of the six.StringIO to read Table object, its giving an error as below, but its fine with String.IO.StringIO module of py2.7, Please suggest the approach to make it run in both the versions without any error As per python doc: its alias, Can you help me to understand this behaviour. Thanks
Here is the example code of it, to read Table object in py2.7: My question here is why six.StringIO is not capable to generate instance like StringIO.StringIO class of py2.7
>> import StringIO
>> StringIO.StringIO(tableObj)
>> <StringIO.StringIO instance at 0x00000000000B2AFF>
>> from six import StringIO as StringIO
>> StringIO.StringIO(tableObj)
Traceback (most recent call last):
File "<pyshell#20>", line 1, in <module>
StringIO.StringIO(tableObj)
TypeError: StringIO() argument 1 must be convertible to a buffer, not Table
>>