imapbackup
imapbackup copied to clipboard
UnicodeEncodeError: 'ascii' codec can't encode character '\xa3'
Hi there,
Ran across an issue with certain language characters in the password, specifically "£" in this case.
Password:
Connecting to 'imap.test.com' TCP port 143
Logging in as '[email protected]'
Traceback (most recent call last):
File "/home/suders/imapbackup/imapbackup38.py", line 793, in <module>
main()
File "/home/suders/imapbackup/imapbackup38.py", line 671, in main
server = connect_and_login(config)
File "/home/suders/imapbackup/imapbackup38.py", line 615, in connect_and_login
server.login(config['user'], config['pass'])
File "/usr/lib/python3.9/imaplib.py", line 610, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
File "/usr/lib/python3.9/imaplib.py", line 1230, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib/python3.9/imaplib.py", line 987, in _command
arg = bytes(arg, self._encoding)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa3' in position 12: ordinal not in range(128)
Unsure how to fix, seems to be an issue with imaplib and what it is being passed. Research suggests that it may be that imaplib is expecting a series of UTF-8 bytes instead of a raw unicode string, but I'm far from knowledgeable on this.
This only seems to be an issue with imapbackup38.py
, the Python 2 one works fine.
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 30 days since being marked as stale.