pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

SoapAdapter / expected str instance, byte found

Open jfleuridas opened this issue 10 years ago • 2 comments

Hi, when trying to connect to a remote hosted vcenter v5.1 (OVH - European host which provides virtual VMWare farm) with pyvmomi (latest github dev version or release) with python 3.4 on windows 8.1 64, I get an exception : msg = 'sequence item 0: expected str instance, bytes found', File "d:\temp\pyvmomi-master\pyVmomi\SoapAdapter.py", line 1116, in read

The fix is quick
inflatedChunk = self.unzip.decompress(chunk) will work better with : inflatedChunk = self.unzip.decompress(chunk).decode('utf-8')

With that 'patch' I can connect and have a sample working (of course I had to struggle with the infamous SSL context bug before). Then I got other errors, and suddenly I wonder if this lib is really compatible with python 3, and if I ever should trust such a buggy piece of software to interact with production servers ...

Anyone else got those bugs ?

jfleuridas avatar Nov 27 '15 17:11 jfleuridas

Ive had best results with 2.7 If you notice there is very little testing for this lib so I would expect there to be a lot of unknown issues with py 3. When the py 3 support was added personally I think it should have been marked as "Possibly compatible" just due to the lack of coverage on the lib.

michaelrice avatar Nov 28 '15 01:11 michaelrice

Ok thanks for the reply. I finally gave up ...

jfleuridas avatar Dec 10 '15 09:12 jfleuridas