Comments (7)
I have tried this also on a Windows 10 PRO running Python 3.8.2 with this...
Exception in thread Thread-Srv:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File ".\pykms_Server.py", line 150, in run
self.server.pykms_serve()
File ".\pykms_Server.py", line 81, in pykms_serve
ready = selector.select(timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
from py-kms.
I have tried this also on a Windows 10 PRO running Python 3.8.2 with this...
Exception in thread Thread-Srv:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File ".\pykms_Server.py", line 150, in run
self.server.pykms_serve()
File ".\pykms_Server.py", line 81, in pykms_serve
ready = selector.select(timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
This is only a guess, but what other Software is running while you attempt this? My guess is, that python looses the socket context, maybe caused by a firewall or an anti-virus software. Please try disable all of them. If that still fails, I'll lool further into that.
from py-kms.
我也在具有此功能的运行Python 3.8.2的Windows 10 PRO上尝试过此操作...
线程Thread-Srv中的异常:
追溯(最近一次调用):
文件“ C:\ Program Files(x86)\ Python38-32 \ lib \ threading.py”,第932行,位于_bootstrap_inner
self.run()
文件中。 \ pykms_Server.py”,第150行,运行
self.server.pykms_serve()
文件“。\ pykms_Server.py”,第81行,pykms_serve
ready = selector.select(timeout)
文件“ C:\ Program Files(x86)” \ Python38-32 \ lib \ selectors.py“,第323行,在选择
r,w,_ = self._select(self._readers,self._writers,[],超时)中,
文件“ C:\ Program Files(x86) \ Python38-32 \ lib \ selectors.py“,第314行,在_select
r,w,x = select.select(r,w,w,timeout)
OSError中:[WinError 10038]尝试对非套接字的对象进行操作这只是一个猜测,但是尝试执行此操作时还会运行什么其他软件?我的猜测是,python会松开套接字上下文,这可能是由防火墙或防病毒软件引起的。请尝试禁用所有这些。如果仍然失败,我将进一步讲解。
I have tried this also on a Windows 10 PRO running Python 3.8.2 with this...
Exception in thread Thread-Srv:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File ".\pykms_Server.py", line 150, in run
self.server.pykms_serve()
File ".\pykms_Server.py", line 81, in pykms_serve
ready = selector.select(timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Program Files (x86)\Python38-32\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socketThis is only a guess, but what other Software is running while you attempt this? My guess is, that python looses the socket context, maybe caused by a firewall or an anti-virus software. Please try disable all of them. If that still fails, I'll lool further into that.
Hello, I have the same mistake. I tried to solve it but failed.
The computer system I run on the server is windows 10. There is no security software and the firewall is closed.
from py-kms.
I have also tries this on HYPER-V vm's running on Server 2019 Standard, Server 2012 R2 Standard and Server 2016 Standard. All VM's very running with no anti virus or security software - out of the box so to speak! All failed to run
from py-kms.
Same here. Used to work find on one of the older releases of py-kms.
this is happening on a container , based on server 1809.
from py-kms.
By now i can't debug anymore versus Windows errors because my Win test Pc is died.
But i think the problem is that i used os.pipe()
with Selectors / select()
and stupid Windows only works for sockets. (https://docs.python.org/3/library/select.html)
A quick and dirty fix is to comment (in pykms_Server.py
) all references to self.r_service, self.w_service
like this:
class KeyServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
daemon_threads = True
allow_reuse_address = True
def __init__(self, server_address, RequestHandlerClass):
socketserver.TCPServer.__init__(self, server_address, RequestHandlerClass)
self.__shutdown_request = False
#self.r_service, self.w_service = os.pipe() #Comment here
if hasattr(selectors, 'PollSelector'):
self._ServerSelector = selectors.PollSelector
else:
self._ServerSelector = selectors.SelectSelector
def pykms_serve(self):
""" Mixing of socketserver serve_forever() and handle_request() functions,
without elements blocking tkinter.
Handle one request at a time, possibly blocking.
Respects self.timeout.
"""
# Support people who used socket.settimeout() to escape
# pykms_serve() before self.timeout was available.
timeout = self.socket.gettimeout()
if timeout is None:
timeout = self.timeout
elif self.timeout is not None:
timeout = min(timeout, self.timeout)
if timeout is not None:
deadline = time() + timeout
try:
# Wait until a request arrives or the timeout expires.
with self._ServerSelector() as selector:
selector.register(fileobj = self, events = selectors.EVENT_READ)
# self-pipe trick.
#selector.register(fileobj = self.r_service, events = selectors.EVENT_READ) #Comment here
while not self.__shutdown_request:
ready = selector.select(timeout)
if self.__shutdown_request:
break
if ready == []:
if timeout is not None:
timeout = deadline - time()
if timeout < 0:
return self.handle_timeout()
else:
for key, mask in ready:
if key.fileobj is self:
self._handle_request_noblock()
#elif key.fileobj is self.r_service: ##Comment this block.
# only to clean buffer.
#msgkill = os.read(self.r_service, 8).decode('utf-8')
#sys.exit(0)
finally:
self.__shutdown_request = False
in this way however py-kms Gui Exit button functionality is lost.
A more appropriate fix (with a next update) is to create a socketpair()
function working with python2 and Windows.
from py-kms.
As far as I know, can this thing be started on Linux and then activated on windows。What is the result of using it?
from py-kms.
Related Issues (20)
- Implement automagic KMS server discovery in pykms_Client HOT 3
- Docker with SQLite fails to start due to incorrect parms HOT 3
- Docker run it is not working with python3 tag HOT 1
- Error: ←[7m←[91m←[1mSO_REUSEPORT not supported on this platform. Exiting...←[0m HOT 2
- What does the "connect" subparameter do? HOT 1
- Confused about some of the defaults HOT 4
- Office Pro 2019 Converted from Retail to Volume Not Genuine Error HOT 4
- If yoy dont like russia HOT 1
- What's the error? HOT 1
- Windows Server 2022 HOT 30
- Add support for Windows Server 2022 to Docker Hub image HOT 11
- latest versions of tzlocal leads to 0xC004F074 error HOT 2
- Server 2022 Update HOT 1
- Broken server help and ather HOT 2
- Cannot Activate MS Office LTSC Professional Plus 2021 HOT 3
- [IMPORTANT] This repository is dead. Please use a fork! HOT 1
- Cannot assign Ip Address (Errno 99) HOT 1
- We need Relation-DB support ?
- systemed keeps crashing HOT 1
- GCC and python3-dev is missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-kms.