ModularM
Modular2y ago
7 replies
abi

Bytes-like object when using a python module

Hi there, I'm checking out mojo and was going to make a little IRC client using the basic python socket module, but I ran into an issue when trying to call socket.send which was: a bytes-like object is required, not 'str'.

So I tried to get the underlying buffer from the string and got a compile error: argument #1 cannot be converted from 'DynamicVector[SIMD[si8, 1]]' to 'PythonObject'

I'm new to mojo and my python is very rusty, but I couldn't find a way to get a bytes-like python object, is there a stdlib function somewhere that I'm missing?
Was this page helpful?