cceremuga / cceremuga/pypacket

aprs messages with unicode in them triggers crash

Open
#78 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
57
Forks
14
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
aprs messages with unicode in them triggers crash

**To Reproduce**
Steps to reproduce the behavior:
1. run ./main.py
2. wait until some funnyman messages "🤪" over packet

see this python trace dump:
```
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/home/chip/pypacket/pypacket/base/receiver.py", line 136, in __decoder_worker
self.__process_decoded_packet(cleaned_packet)
File "/home/chip/pypacket/pypacket/base/receiver.py", line 102, in __process_decoded_packet
processor.handle(decoded_packet)
File "/home/chip/pypacket/pypacket/implementations/cli_processor.py", line 32, in handle
self.log_handler.log_packet(packet, print_friendly_packet)
File "/home/chip/pypacket/pypacket/util/logger.py", line 58, in log_packet
self.__log_any(Colors.RESET, '', friendly_message)
File "/home/chip/pypacket/pypacket/util/logger.py", line 69, in __log_any
print(color + prefix + Colors.RESET + log_message)
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f92a' in position 444: ordinal not in range(128)

```

**Expected behavior**
one more log line.

**Screenshots**
see pasted python trace

**System info (please complete the following information):**
- OS: [pocketchip running debian-ish ~2016]
- Python Version 3.9 built from source
- PyPacket Version: HEAD from feb 2021

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.