jorgebastida / awslogs

AWS CloudWatch logs for Humans™
Other
4.86k stars 335 forks source link

UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f451' in position 329: character maps to <undefined> #299

Closed per-activote closed 7 months ago

per-activote commented 4 years ago

When downloading logs, I got the following traceback. This happens on Windows, but running the same machine on a Mac works perfectly:

`Version: 0.11.0 Python: 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] boto3 version: 1.13.10 Platform: Windows-10-10.0.18362-SP0 Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'log_group_name': '', 'log_stream_name': 'ALL', 'filter_pattern': None, 'watch': False, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'output_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '2020-06-05', 'end': '2020-06-06', 'color': 'auto', 'query': None, 'func': 'list_logs'} Args: ['F:\Python\Python38-32\Scripts\awslogs', 'get', '', '--start', '2020-06-05', '--end', '2020-06-06']

Traceback (most recent call last): File "f:\python\python38-32\lib\site-packages\awslogs\bin.py", line 178, in main getattr(logs, options.func)() File "f:\python\python38-32\lib\site-packages\awslogs\core.py", line 223, in list_logs consumer() File "f:\python\python38-32\lib\site-packages\awslogs\core.py", line 212, in consumer print(' '.join(output)) File "f:\python\python38-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f451' in position 329: character maps to

jorgebastida commented 7 months ago

Fixed as part of https://github.com/jorgebastida/awslogs/pull/396