Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

UnicodeEncodeError in matrix.py #289

Closed
jquast opened this issue Sep 13, 2016 · 3 comments
Closed

UnicodeEncodeError in matrix.py #289

jquast opened this issue Sep 13, 2016 · 3 comments

Comments

@jquast
Copy link
Owner

jquast commented Sep 13, 2016

~% telnet 1984.ws
Trying 88.80.6.213...
Connected to 1984.ws.
Escape character is '^]'.
:: Connected to x/84.
:: See https://github.com/jquast/x84/ for source code.
                                                                     `
                                             ..                     ::             .
                                             ..                     ..             ::
                                             ::  ____        _____  ..   /\____     _____  xz(imp)
                                        ___  ' __\  /___   __\   /__ ' __\    /_   /    /____    ___
                                        +  '---\        \--\  __    \--\   __   \--\    \   /---`  +
                                        |%   __/         \ /  |/     \ /   |/    \ /        \__   _|
                                   .--  :%  /\        ##  \    ____   \    __     \   __ ##   /\  %:  --.
                                   |::  |%  \ \_____      /____|      /____|/     /___|      / /  %|  ::|
                                   |::: |%   \/____|_____/_____|_____/_____|_____/ ___|_____/ /   %| :::|
                                   '--- |"        /_____/     /_____/       \____\/   \_____\/    %| ---`
                                        +__,-----,_______,-----,__,-------------------,__,-----,___+
                                             .:                     ::             ::
                                             ::   >> 1984.ws        '               .
                                             '
   Login as 'new' to create an account.
   Login as 'anonymous' is allowed.
   Forgot password? Login as 'reset'.

:: Login: d¡ngo

:: Password:
  File "x84/bbs/session.py", line 366, in run
    self.runscript(self._script_stack.pop())

  File "x84/bbs/session.py", line 708, in runscript
    value = module.main(*script.args, **script.kwargs)

  File "/usr/local/src/x84/x84/default/matrix.py", line 284, in main
    do_login(term)

  File "/usr/local/src/x84/x84/default/matrix.py", line 250, in do_login
    user = authenticate_user(handle, password)

  File "/usr/local/src/x84/x84/default/matrix.py", line 189, in authenticate_user
    .format(handle=handle))

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa1' in position 1: ordinal not in range(128)


stop after general exception in matrix
Connection closed by foreign host.
@haliphax
Copy link
Collaborator

Do all of the logger functions just need to use unicode strings, then? Is that the issue? This is the code in question:

log.debug('Failed login for {handle}: no such user.'.format(handle=handle))

Could become:

log.debug(u'Failed login for {handle}: no such user.'.format(handle=handle))

@haliphax
Copy link
Collaborator

Actually, upon deeper inspection, this seems to be a problem with the console logger or the formatter's format string. Since the format string is loaded from a file, I'm not sure that it's loaded as unicode.

@jquast
Copy link
Owner Author

jquast commented Oct 19, 2016

Comment removed, sorry @nuklearpony call anytime.

@jquast jquast closed this as completed Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants