← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 714957] Re: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0'

 

If you are on production and you do not want to upgrade your module.

Open this file on your ubuntu server:
 /usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect_generic.zip/magentoerpconnect_generic/product_images.py

And comment line like that:
#print "Sending %s's image: %s" % (each.product_id.name, each.product_id.magento_sku)

Your error comes from certainly  by non ascii char on product name, but
this line is just for logging info.  It is petty to get error cause by
debug system.

Other solution change the line by:
print "Sending %s's image: %s" % (each.product_id.name.encode('utf8'), each.product_id.magento_sku)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/714957

Title:
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0'

Status in Magento Open ERP Connector:
  New

Bug description:
  I'm not sure this is a bug. please excuse this post if not relavent. I am working on a openerp V5.015 mageno connect V5 under french language. All synchro is working except for this type of error accuring periodicly. I've tried to not use é or à type of characters withought any succes. This error is only produced if I try to include an image from openerp (even with no accents)
  This is message. After investigating it seems a file should be called in 'UTF8' but wich file? The server in under ubuntu the client is windows.

  
  Environment Information : 
  System : Windows-32bit
  OS Name : nt
  Operating System Release : 
  Operating System Version : 32bit
  Operating System Architecture : 32bit
  Operating System Locale : fr_FR.cp1252
  Python Version : 2.5.2
  OpenERP-Client Version : 5.0.15
  Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 299, in dispatch
      result = LocalService(service_name)(method, *params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 77, in __call__
      return getattr(self, method)(*params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 577, in execute
      res = service.execute(db, uid, object, method, *args)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 58, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 119, in execute
      res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 111, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect_generic.zip/magentoerpconnect_generic/sale.py", line 64, in export_images
      res = self.pool.get('product.images').update_remote_images(cr, uid, recent_changed_images, ctx)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/magentoerpconnect_generic.zip/magentoerpconnect_generic/product_images.py", line 83, in update_remote_images
      print "Sending %s's image: %s" % (each.product_id.name, each.product_id.magento_sku)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 48: ordinal not in range(128)





References