My implementation of sethostname() was broken and failed when passed bytes on Python 3. Update the implementation to match CPython -- that is, use bytes if provided, or fsencode() when str is provided.
Due to a massive storm of spam, registration on this instance now requires explicit administrator approval. Sorry for the added friction, we're also looking into automatic filtering options.
My implementation of sethostname() was broken and failed when passed bytes on Python 3. Update the implementation to match CPython -- that is, use bytes if provided, or fsencode() when str is provided.