[docs] socket.sethostname() error type mistake

Andrew Svetlov andrew.svetlov at gmail.com
Tue Sep 3 14:54:06 CEST 2013


PermissionError is subclass of OSError.
There are outer possible errors by socket.sethostname() call, so doc is correct.

On Mon, Aug 12, 2013 at 6:42 PM, Simeon S <simeon.simeonov.s at gmail.com> wrote:
> Hi,
>
> I believe there is a mistake in the type of error raised by
> socket.sethostname(). The documentation says the error returned is
> OSError. Here is what I get (3.3.2):
>
> [16:39:sys]
>  % python3
> Python 3.3.2 (default, Aug  5 2013, 11:52:10)
> [GCC 4.5.3] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import socket as s
>>>> s.sethostname('bla')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> PermissionError: [Errno 1] Operation not permitted
>
> Simeon
> _______________________________________________
> docs mailing list
> docs at python.org
> https://mail.python.org/mailman/listinfo/docs



-- 
Thanks,
Andrew Svetlov


More information about the docs mailing list