[issue37640] telnetlib crash in Python3 while receiving un-printable characters from server

hoang nguyen report at bugs.python.org
Sun Jul 21 05:17:08 EDT 2019


New submission from hoang nguyen <hoangcntt13 at gmail.com>:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/Pwn/Pwn.py", line 209, in io
    self.con.interact()
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/telnetlib.py", line 553, in interact
    sys.stdout.write(text.decode('ascii'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 41: ordinal not in range(128)
```
crash detail

set up a netcat server:
```
cat /dev/urandom | nc -l 127.0.0.1 8888
```

test.py
```
import telnetlib

tn = telnetlib.Telnet('127.0.0.1', 8888)
tn.interact()
```

----------
components: Library (Lib)
files: test.py
messages: 348233
nosy: hoang nguyen
priority: normal
severity: normal
status: open
title: telnetlib crash in Python3 while receiving un-printable characters from server
type: crash
versions: Python 3.6
Added file: https://bugs.python.org/file48494/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37640>
_______________________________________


More information about the Python-bugs-list mailing list