[Python] UnicodeEncodeError: 'ascii' codec can't encode character u'\u200c' in position 0: ordinal not in range(128)

Balan Victor balan.victor0 a gmail.com
Ven 17 Ago 2012 12:49:34 CEST


Salve a tutti,
sto usando questo package:
http://packages.python.org/psphere/tutorial.html

e nel tutorial sono fermo a questo punto

>>> from psphere.client import Client>>> from psphere.managedobjects import VirtualMachine>>> client = Client("your.esxserver.com", "Administrator", "strongpass")>>> vm = VirtualMachine.get(client, name="genesis")

e ottengo l'errore in oggetto:

>>> vm = VirtualMachine.get(client, name="genesis")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\managedobjects.py",
line 133, in get    return
client.find_entity_view(cls.__name__,filter=filter, properties=properties)
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\client.py",
line 585, in find_entity_view    obj_contents =
self.sc.propertyCollector.RetrieveProperties(specSet=pfs)
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\__init__.py",
line 352, in func    **kwargs)
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\client.py",
line 198, in invoke    new_result.append(self._unmarshal(item))
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\client.py",
line 265, in _unmarshal    new_emb_obj = self._unmarshal(emb_obj)
  File
"C:\Python27\lib\site-packages\psphere-0.5.1-py2.7.egg\psphere\client.py",
line 260, in _unmarshal    logger.debug("Looking at %s of type %s" %
(str(sub_obj), type(sub_obj)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u200c' in
position 0
: ordinal not in range(128)



alla riga 259-260 del file client.py ho questo codice:
        for sub_obj in obj:
            logger.debug("Looking at %s of type %s" % (str(sub_obj),
type(sub_obj)))


qualcuno mi puņ aiutare?
-------------- parte successiva --------------
Un allegato HTML č stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20120817/0e66d775/attachment.html>


Maggiori informazioni sulla lista Python