Debriefing > Bug Reports & Fixes
[ISSUE] [Solved] ImportError: No module named '_socket'
(1/1)
Phivex:
The error " ImportError: No module named '_socket' " is raised and the game crashes after creating a server whenever I import "from logging.handlers import RotatingFileHandler" into "...\GamePlay\__inti__.py" It doesn't mind when I use "import logging", but it doesn't like the RotatingFileHandler class.
Below is the error in the python.log. Anything I can do to fix it? I can import both the RotatingFileHandler and _socket with my own version of Python (2.7.12), so I imagine it's maybe using an older version of Python from before the current implementation of the RotatingFileHandler class?
--- Code: ---
Traceback (most recent call last):
File "c:\program files (x86)\steam\steamapps\sourcemods\gesource\python/ges\GESInit.py", line 43, in LoadManager
__import__( name, globals(), locals() )
File "c:\program files (x86)\steam\steamapps\sourcemods\gesource\python/ges\GamePlayManager.py", line 23, in <module>
import GamePlay
File "c:\program files (x86)\steam\steamapps\sourcemods\gesource\python/ges\GamePlay\__init__.py", line 27, in <module>
from logging.handlers import RotatingFileHandler
File "c:\program files (x86)\steam\steamapps\sourcemods\gesource\python/lib\logging\handlers.py", line 26, in <module>
import logging, socket, os, pickle, struct, time, re
File "c:\program files (x86)\steam\steamapps\sourcemods\gesource\python/lib\socket.py", line 47, in <module>
import _socket
ImportError: No module named '_socket'
--- End code ---
killermonkey:
Sockets are not supported in our build of Python for security reasons.
Phivex:
Ah. Okay. That makes sense then. Thanks for taking cyber security into consideration. It's too often thrown to the wayside for convenience.
I was hoping to use the module so I wouldn't have to worry about a file getting to large when collecting stats. Now I'll probably just tell the program to clean the file at startup each time. I was just hoping to avoid that since it would decrease portability having more code in multiple places.
killermonkey:
hmmmmm, after looking into this it looks like we should probably include socket... I think it breaks a lot more modules then I anticipated...
Navigation
[0] Message Index
Go to full version