[issue30430] Cannot write to a tun interface file

Antoine Pitrou report at bugs.python.org
Mon May 22 11:19:59 EDT 2017


Antoine Pitrou added the comment:

I know nothing about TUN but you may simply be hitting this code path:
https://github.com/spotify/linux/blob/master/drivers/net/tun.c#L601-L614

Since:
>>> ('e'.encode()[0] & 0xf0) in (0x40, 0x60)
True
>>> ('é'.encode()[0] & 0xf0) in (0x40, 0x60)
False

writing 'é'.encode() will hit the EINVAL-returning path.  The bottom line is that TUN devices don't seem to support free-form data, but expect a certain format.

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30430>
_______________________________________


More information about the Python-bugs-list mailing list