{"action":"created","issue":{"url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/233","labels_url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/233/comments","events_url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/233/events","html_url":"https://github.com/OfflineIMAP/offlineimap/issues/233","id":103910281,"number":233,"title":"Failure  due to TypeError in hmac.py","user":{"login":"schoeke","id":1077573,"avatar_url":"https://avatars.githubusercontent.com/u/1077573?v=3","gravatar_id":"","url":"https://api.github.com/users/schoeke","html_url":"https://github.com/schoeke","followers_url":"https://api.github.com/users/schoeke/followers","following_url":"https://api.github.com/users/schoeke/following{/other_user}","gists_url":"https://api.github.com/users/schoeke/gists{/gist_id}","starred_url":"https://api.github.com/users/schoeke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schoeke/subscriptions","organizations_url":"https://api.github.com/users/schoeke/orgs","repos_url":"https://api.github.com/users/schoeke/repos","events_url":"https://api.github.com/users/schoeke/events{/privacy}","received_events_url":"https://api.github.com/users/schoeke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OfflineIMAP/offlineimap/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-30T09:23:11Z","updated_at":"2015-08-31T13:02:31Z","closed_at":"2015-08-31T11:09:58Z","body":"Hi,\r\n\r\nI try to download the contents of 4 mail accounts, three of which are all on the same server. For these three accounts, I get an error:\r\n\r\n```\r\nERROR: While attempting to sync account 'test'\r\n  character mapping must return integer, None or unicode\r\n *** Finished account 'test' in 0:00\r\n```\r\n\r\nI (somehow) was able to get a more elaborate traceback and this is the result:\r\n\r\n```\r\n ERROR: Exceptions occurred during the run!\r\n ERROR: While attempting to sync account 'test'\r\n  character mapping must return integer, None or unicode\r\n\r\nTraceback:\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/accounts.py\", line 263, in syncrunner\r\n    self.__sync()\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/accounts.py\", line 326, in __sync\r\n    remoterepos.getfolders()\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/repository/IMAP.py\", line 351, in getfolders\r\n    imapobj = self.imapserver.acquireconnection()\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py\", line 451, in acquireconnection\r\n    self.__authn_helper(imapobj)\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py\", line 354, in __authn_helper\r\n    if func(imapobj):\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py\", line 279, in __authn_cram_md5\r\n    imapobj.authenticate('CRAM-MD5', self.__md5handler)\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imaplib2.py\", line 662, in authenticate\r\n    typ, dat = self._simple_command('AUTHENTICATE', mechanism.upper())\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imaplib2.py\", line 1633, in _simple_command\r\n    return self._command_complete(self._command(name, *args), kw)\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imaplib2.py\", line 1369, in _command\r\n    literal = literator(data, rqb)\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imaplib2.py\", line 2220, in process\r\n    ret = self.mech(self.decode(data))\r\n  File \"/usr/local/Cellar/offline-imap/6.5.7/libexec/offlineimap/imapserver.py\", line 176, in __md5handler\r\n    retval = self.username + ' ' + hmac.new(passwd, challenge).hexdigest()\r\n  File \"/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py\", line 136, in new\r\n    return HMAC(key, msg, digestmod)\r\n  File \"/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py\", line 75, in __init__\r\n    self.outer.update(key.translate(trans_5C))\r\n```\r\n\r\nFrom my research, it seems the hmac.py probably expects a string and receives a byte sequence, but I am not sure and I am not sure how to fix it. Also, I am wondering why this occurs only on one server.\r\n\r\nHere is my abbreviated config:\r\n\r\n```\r\n[Account test]\r\nlocalrepository  = test-local\r\nremoterepository = test-remote\r\nstatus_backend   = sqlite\r\nautorefresh      = 1\r\npostsynchook = /usr/local/bin/notmuch new\r\n\r\n...\r\n\r\n[Repository test-local]\r\ntype         = Maildir\r\nlocalfolders = ~/Mail/test/\r\n\r\n...\r\n\r\n[Repository test-remote]\r\ntype               = IMAP\r\nssl                = yes\r\ncert_fingerprint   = DBF7EBDEE5885DF7E6473633416A0B030AC4C80D\r\nremotehost         = mail.server.tld\r\nremoteuser         = test@server.tld\r\nremotepasseval     = keyring.get_password('test@server.tld', 'test@server.tld')\r\nmaxconnections     = 5\r\nholdconnectionopen = yes\r\n\r\n...\r\n```\r\n\r\nAny help would be appreciated.Please ask if you need more details."},"comment":{"url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/comments/136364591","html_url":"https://github.com/OfflineIMAP/offlineimap/issues/233#issuecomment-136364591","issue_url":"https://api.github.com/repos/OfflineIMAP/offlineimap/issues/233","id":136364591,"user":{"login":"schoeke","id":1077573,"avatar_url":"https://avatars.githubusercontent.com/u/1077573?v=3","gravatar_id":"","url":"https://api.github.com/users/schoeke","html_url":"https://github.com/schoeke","followers_url":"https://api.github.com/users/schoeke/followers","following_url":"https://api.github.com/users/schoeke/following{/other_user}","gists_url":"https://api.github.com/users/schoeke/gists{/gist_id}","starred_url":"https://api.github.com/users/schoeke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schoeke/subscriptions","organizations_url":"https://api.github.com/users/schoeke/orgs","repos_url":"https://api.github.com/users/schoeke/repos","events_url":"https://api.github.com/users/schoeke/events{/privacy}","received_events_url":"https://api.github.com/users/schoeke/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T13:02:31Z","updated_at":"2015-08-31T13:02:31Z","body":"Fixed it. Thanks."}}