I've been working on a TCP/IP connection program thingy in Python and came across the need to use Struct. And so I imported the module and after some time came to a very particular issue. I get the error specified in te title when I run the code below, which should be working after I checked some other answers and documentations.

```
import struct

string = "blab"

s = struct.Struct(b'4s')
packed_data = s.pack(string)

print(packed_data)

```

As far as I found, the issue should be fixed by prepending the string used in the s variable with 'b' or using the `bytes()` function parsing 'utf-8' as encoding argument. Tried both, same error. 

I have no idea what might be wrong so am I missing something? I could not find relevant information online regarding this issue, so this is why I'm posting here now.

Any help is appreciated and thanks in advance!