vmware / vmware/pyvmomi

SoapAdapter / expected str instance, byte found

Open
#318 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs verification
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The reported failure is in pyVmomi/SoapAdapter.py at line 1116; start by reproducing the Python 3.4 connection path and inspecting how read() handles decompressed chunks. Done means the reported bytes-versus-str exception no longer occurs during the vCenter connection, with the behavior checked against a focused regression test or reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.