pyinotify icon indicating copy to clipboard operation
pyinotify copied to clipboard

Don't you get null bytes from this method?

Open sphaero opened this issue 9 years ago • 1 comments

See: https://github.com/seb-m/pyinotify/blob/master/python3/pyinotify.py#L1236

What do you do about the null bytes which can be returned?

sphaero avatar Apr 29 '16 13:04 sphaero

I mean, when a filename equals "test" the bytearray length containing the string will be 16 for example. If you then unpack it you will end up with

b'test\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

If you decode that to a string you will end up with:

'test\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

as a string.

sphaero avatar Apr 29 '16 14:04 sphaero