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.
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.