Skip to content
Advertisement

TypeError argument must be an int or have a fileno() method

Seen here https://stackoverflow.com/search?q=TypeError+argument+must+be+an+int+or+have+a+fileno%28%29+method

But just can’t quite find my answer. I am trying out a chat script

Server side runs perfectly fine.

JavaScript

But client

JavaScript

Has run from cmd, not IDLE because of issues (read something about it relating to my issue)

Traceback

JavaScript

Advertisement

Answer

select doesn’t work with non-socket objects on Windows. For more information see the documentation about select.select, where it mentions that:

File objects on Windows are not acceptable, but sockets are. On Windows, the underlying select() function is provided by the WinSock library, and does not handle file descriptors that don’t originate from WinSock.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement