Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Win) --log can't save lines containing ancient alien characters #174

Open
bongobongoland opened this issue Feb 9, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@bongobongoland
Copy link
Contributor

--- Logging error ---
Traceback (most recent call last):
  File "logging\__init__.py", line 1113, in emit
  File "encodings\cp1251.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 130-136: character maps to <undefined>
Call stack:
  File "threading.py", line 1002, in _bootstrap
  File "threading.py", line 1045, in _bootstrap_inner
  File "threading.py", line 982, in run
  File "concurrent\futures\thread.py", line 83, in _worker
  File "concurrent\futures\thread.py", line 58, in run
  File "C:\Users\poopypants\AppData\Local\Temp\_MEI49042\nxc\protocols\smb.py", line 167, in __init__
    connection.__init__(self, args, db, host)
  File "connection.py", line 121, in __init__
  File "connection.py", line 174, in proto_flow
  File "connection.py", line 195, in call_cmd_args
  File "C:\Users\poopypants\AppData\Local\Temp\_MEI49042\nxc\protocols\smb.py", line 1109, in users
    return UserSamrDump(self).dump()
  File "C:\Users\poopypants\AppData\Local\Temp\_MEI49042\nxc\protocols\smb\samruser.py", line 61, in dump
    self.fetchList(rpctransport)
  File "C:\Users\poopypants\AppData\Local\Temp\_MEI49042\nxc\protocols\smb\samruser.py", line 121, in fetchList
    self.logger.highlight(f"{self.domain}\\{user['Name']:<30} {info_user}")
  File "logger.py", line 106, in highlight
  File "logger.py", line 131, in log_console_to_file
  File "logging\__init__.py", line 978, in handle
  File "logging\handlers.py", line 75, in emit
  File "logging\__init__.py", line 1230, in emit
  File "logging\__init__.py", line 1118, in emit

@NeffIsBack
Copy link
Contributor

Can you give me a character that produces that error?

@NeffIsBack NeffIsBack added the bug Something isn't working label Feb 9, 2024
@bongobongoland
Copy link
Contributor Author

any Chinese or Thai characters.

@NeffIsBack
Copy link
Contributor

Would changing the default codec to utf-8 solve the problem? Is this compatible with Chinese characters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants