← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 581854] Re: SMTP Server Login Error An error occurred : character mapping must return integer, None or unicode

 

Hi Sharoon,

Yes, it works. With this line:
"serv.login(this_object.smtpuname.encode('UTF-8'),
this_object.smtppass.encode('UTF-8'))" , it works.

Thanks you.

-- 
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/581854

Title:
  SMTP Server Login Error  An error occurred : character mapping must
  return integer, None or unicode

Status in Power e-Mail for Open ERP:
  New

Bug description:
  I am using Power Email 5.0.0.7 RC with python2.6 in openERP Sever 5.0.10
  When I try to check outgoing Connection, this error is showed:
  "SMTP Server Login Error  An error occurred : character mapping must return integer, None or unicode "

  stack trace :

  [2010-05-18 09:31:16,240] DEBUG:Connection:create cursor to "laboratoriosPruebas"
  [2010-05-18 09:31:16,240] DEBUG:ConnectionPool:ConnectionPool(used=0/count=1/max=64) Borrow connection to user=leo dbname=laboratoriosPruebas
  [2010-05-18 09:31:16,240] DEBUG:ConnectionPool:ConnectionPool(used=1/count=1/max=64) Existing connection found at index 0
  [2010-05-18 09:31:16,427] DEBUG:ConnectionPool:ConnectionPool(used=1/count=1/max=64) Give back connection to user=leo dbname=laboratoriosPruebas
  [2010-05-18 09:31:16,428] DEBUG:ConnectionPool:ConnectionPool(used=0/count=1/max=64) Put connection to user=leo dbname=laboratoriosPruebas in pool
  /usr/lib/python2.5/site-packages/openerp-server/tools/misc.py:750: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    if hasattr(e, 'message'):
  /usr/lib/python2.5/site-packages/openerp-server/tools/misc.py:751: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    return ustr(e.message)
  [2010-05-18 09:31:16,429] DEBUG_RPC:exception:u'warning -- SMTP Server Login Error\n\nAn error occurred : character mapping must return integer, None or unicode '
  [2010-05-18 09:31:16,738] DEBUG_RPC:service:'object'
  [2010-05-18 09:31:16,738] DEBUG_RPC:method:'execute'
  [2010-05-18 09:31:16,740] DEBUG_RPC:params:[01]: ('laboratoriosPruebas',
  [2010-05-18 09:31:16,740] DEBUG_RPC:params:[02]:  1,
  [2010-05-18 09:31:16,740] DEBUG_RPC:params:[04]:  'ir.attachment',
  [2010-05-18 09:31:16,740] DEBUG_RPC:params:[05]:  'search_count',
  [2010-05-18 09:31:16,741] DEBUG_RPC:params:[06]:  [('res_model', '=', u'poweremail.core_accounts'), ('res_id', '=', 1)])
  [2010-05-18 09:31:16,741] DEBUG:Connection:create cursor to "laboratoriosPruebas"

  Not always, I tried with two email accounts with one work and the
  other is not

  It's a problem with python2.6.

  I fixed writing in poweremail_core.py :

  def out_connection(self, cr, uid, ids, context={}):
  ...........
                  try:
                      if serv.has_extn('AUTH') or rec.smtpuname or rec.smtppass:
                          serv.login(rec.smtpuname.encode('utf-8'), rec.smtppass.encode('utf-8'))
  ..............