Home > operation was > python error 10038

Python Error 10038

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn python select.error (10038 'an operation was attempted on something that is not a socket') more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags an operation was attempted on something that is not a socket windows 7 Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, python select stdin windows helping each other. Join them; it only takes a minute: Sign up Can select() be used with files in Python under Windows? up vote 6 down vote favorite 2 I am trying to run the following python server

Python Oserror Winerror 10038

under windows: """ An echo server that uses select to handle multiple clients at a time. Entering any line of input at the terminal will exit the server. """ import select import socket import sys host = '' port = 50000 backlog = 5 size = 1024 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((host,port)) server.listen(backlog) input = [server,sys.stdin] running = 1 while running: inputready,outputready,exceptready = select.select(input,[],[]) for s in inputready: if s == server: # handle the server an operation was attempted on something that is not a socket c# socket client, address = server.accept() input.append(client) elif s == sys.stdin: # handle standard input junk = sys.stdin.readline() running = 0 else: # handle all other sockets data = s.recv(size) if data: s.send(data) else: s.close() input.remove(s) server.close() I get the error message (10038, 'An operation was attempted on something that is not a socket'). This probably relates back to the remark in the python documentation 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.". On internet there are quite some posts on this topic, but they are either too technical for me or simply not clear. So my question is: is there any way the select() statement in python can be used under windows? Please add a little example or modify my code above. Thanks! python windows select file-io share|improve this question edited Sep 19 '12 at 22:38 Piotr Dobrogost 21.4k15119207 asked May 31 '12 at 23:04 Django 1251413 hattip @agf. Duly noted! –inspectorG4dget Jun 1 '12 at 0:17 Source of the code above: ilab.cs.byu.edu/python/threadingmodule.html –schmijos Nov 29 '13 at 14:00 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote Look like it does not like sys.stdin If you change input to t

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn sys.stdin python windows more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags

Select.select Python Windows

Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you,

Python Select Windows

helping each other. Join them; it only takes a minute: Sign up python select.select() on Windows up vote 3 down vote favorite 4 I'm testing UDP punching using code from here. It works on Linux however reports error http://stackoverflow.com/questions/10842428/can-select-be-used-with-files-in-python-under-windows on Windows. Here's the code snippet where the error occurs: while True: rfds, _, _ = select([0, sockfd], [], []) # sockfd is a socket if 0 in rfds: data = sys.stdin.readline() if not data: break sockfd.sendto(data, target) elif sockfd in rfds: data, addr = sockfd.recvfrom(1024) sys.stdout.write(data) And error msg: Traceback (most recent call last): File "udp_punch_client.py", line 64, in main() File "udp_punch_client.py", line 50, in main rfds, _, _ = select([0, sockfd], [], []) select.error: http://stackoverflow.com/questions/22251809/python-select-select-on-windows (10038, '') I know this error has some thing to do with the select implementation on Windows, and everyone quote this: Note 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. So I got two questions: What does 0 in [0, sockfd] mean? Is this some sort often-used technique? If select only works with socket on Windows, How to make the code Windows compatible? Thank you. python windows sockets select share|improve this question edited Mar 8 '14 at 7:24 asked Mar 7 '14 at 13:45 laike9m 4,81322555 1 0 is the fd for stdin. File Descriptors –tmr232 Mar 7 '14 at 14:16 @tmr232 any idea how to modify the code? –laike9m Mar 7 '14 at 15:05 @J.F.Sebastian Alright –laike9m Mar 8 '14 at 7:24 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted Unfortunately, select will not help you to process stdin and network events in one thread, as select can't work with streams on Windows. What you need is a way to read stdin without blocking. You may use: An extra thread for stdin. That should work fine and be the easiest way to do the job. Python threads support i

Sign in Pricing Blog Support Search GitHub This repository Watch https://github.com/python-zk/kazoo/issues/78 63 Star 578 Fork 225 python-zk/kazoo Code Issues 62 Pull requests 47 Projects 0 Pulse Graphs New issue Got "error: (10038, '')" on windows http://code.activestate.com/lists/python-list/418339/ when connect. #78 Closed viewstar000 opened this Issue May 3, 2013 · 19 comments Projects None yet Labels None yet Milestone operation was No milestone Assignees No one assigned 8 participants viewstar000 commented May 3, 2013 I have add a print before select, and the logs are: INFO:kazoo.client:Skipping state change INFO:kazoo.protocol.connection:Connecting to 127.0.0.1:2181 ([], [], [], 10000) {} ([], [], [], 10000) {} ([], [], [], 10000) {} operation was attempted INFO:kazoo.client:Zookeeper connection established, state: CONNECTED ([, 3], [], [], 2.9433333333333334) {} ERROR:kazoo.protocol.connection:(10038, '') Traceback (most recent call last): File "C:\Python27\lib\site-packages\kazoo-1.1dev-py2.7.egg\kazoo\protocol\connection.py", line 475, in _connect_loop [], [], timeout)[0] File "C:\Python27\lib\site-packages\kazoo-1.1dev-py2.7.egg\kazoo\handlers\threading.py", line 255, in select return select.select(args, *kwargs) error: (10038, '') Exception in thread Thread-3: Traceback (most recent call last): File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner self.run() File "C:\Python27\lib\threading.py", line 504, in run self.__target(self.__args, *self.__kwargs) File "C:\Python27\lib\site-packages\kazoo-1.1dev-py2.7.egg\kazoo\protocol\connection.py", line 435, in zk_loop if self._connect_loop(retry) is False: File "C:\Python27\lib\site-packages\kazoo-1.1dev-py2.7.egg\kazoo\protocol\connection.py", line 475, in _connect_loop [], [], timeout)[0] File "C:\Python27\lib\site-packages\kazoo-1.1dev-py2.7.egg\kazoo\handlers\threading.py", line 255, in select return select.select(args, *kwargs) error: (10038, '') my platform: Windows7 32bit, Python 2.7 Zookeeper 3.4.5 with JRE 1.7 on windows 7 32bit. hannosch referenced this issue May 24, 2013 Closed KazooTestHarness on Windows #91 mrtheb commented Jun 4, 2013 I digged a little and found that it was introduced in versi

Perl Lists Python Lists PHP Lists Ruby Lists Tcl Lists ActiveState Lists Lists » python-list Using select([sys.stdin]) on windows xp From: John Taylor 6 Oct 2004 07:56:38 -0700 I am using some jabber code that uses this: while(1): inputs, outputs, errors = select.select([sys.stdin], [], [],1) if sys.stdin in inputs: doCmd(con,sys.stdin.readline()) else: con.process(1) However, I get this error: select.error: (10038, 'An operation was attempted on something that is not a socket') According the the Python docs: On Windows, the underlying select() function is provided by the WinSock library, and does not handle file desciptors that don't originate from WinSock. So I was wondering how I can change the code above to run on windows xp. Any help would greatly appreciated. Thanks, -John Recent Messages in this Thread Using select([sys.stdin]) on windows xp John Taylor Oct 06, 2004 02:56 pm Using select([sys.stdin]) on windows xp Josiah Carlson Oct 06, 2004 03:23 pm Using select([sys.stdin]) on windows xp Daniel Dittmar Oct 06, 2004 03:35 pm ◄ Messages in this thread ►

Previous post: How to improve extracting data speed Next post: Question mark in variable and function names Subscribe to the python-list RSS feed Accounts List Archives Perl ListsPython ListsPHP ListsRuby ListsTcl ListsActiveState Lists Manage ActiveState Subscriptions Feedback & Information Give Site Feedback Report a Site Problem About FAQ Terms of Service ActiveState ActiveState Blog Perl Solutions Python Solutions Tcl Solutions Download ActivePerl Download ActivePython Download ActiveTcl About ActiveState Careers Privacy Policy | Contact Us | Support © 2016 ActiveState Software Inc. All rights reserved. ActiveState, Komodo, ActiveState Perl Dev Kit, ActiveState Tcl Dev Kit, ActivePerl, ActivePython, and ActiveTcl are registered trademarks of ActiveState. All other marks are property of their respective owners.

 

Related content

error #7 operation canceled by user

Error Operation Canceled By User table id toc tbody tr td div id toctitle Contents div ul li a href The Operation Was Canceled By The User Vmware Workstation a li li a href Veeam Operation Was Canceled By User a li li a href vmware Error Error The Operation Was Canceled a li ul td tr tbody table p NSXVirtual SAN vCenterFusionWorkstationvExpertVMware code CloudCredSubmit a Link Home VMTN Workstation Player Discussions Please enter a title You can not post a blank message Please type your message and try again Replies Latest reply Sep AM by harbox VMWare Player error

error 1223 the operation was canceled by the user

Error The Operation Was Canceled By The User table id toc tbody tr td div id toctitle Contents div ul li a href Error While Powering On The Operation Was Canceled By The User a li li a href The Operation Was Canceled By The User Vmware Workstation a li li a href Error Code Mysql a li li a href Xampp Mysql Error a li ul td tr tbody table p Advanced Search Web Store BrightSparks Home Forum Home Retired Software SyncBack relatedl V freeware Search Error codes veeam error operation was canceled by user and SyncBack freeware has

error 7 operation cancelled by user

Error Operation Cancelled By User table id toc tbody tr td div id toctitle Contents div ul li a href The Operation Was Canceled By The User C a li li a href Veeam Operation Was Canceled By User a li li a href Andy Emulator Operation Was Canceled a li ul td tr tbody table p Operation Cancelled By User Availability for the Always-On Enterprise Post a reply posts bull Page of bull Operation Cancelled By User by A's Tech relatedl raquo Wed Sep pm people like this vmware error while powering on the operation was canceled by the

operation was canceled due to an internal error

Operation Was Canceled Due To An Internal Error p games PC games Windows games Windows phone games Entertainment All Entertainment Movies TV Music Business Education Business Students educators Developers Sale Sale Find a store Gift cards Products Software services Windows Office Free downloads security Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies TV Devices Xbox All Microsoft devices Microsoft Surface All Windows PCs tablets PC accessories Xbox games Microsoft Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface

operation was cancelled due to an internal error

Operation Was Cancelled Due To An Internal Error p games PC games Windows games Windows phone games Entertainment All Entertainment Movies TV Music Business Education Business Students educators Developers Sale Sale Find a store Gift cards Products Software services Windows Office Free downloads security Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies TV Devices Xbox All Microsoft devices Microsoft Surface All Windows PCs tablets PC accessories Xbox games Microsoft Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface