GoldenEye: Source Forums

  • November 26, 2024, 11:24:29 pm
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: [ISSUE] [Solved] ImportError: No module named '_socket'  (Read 12737 times)

0 Members and 1 Guest are viewing this topic.

Phivex

  • Agent
  • *
  • Posts: 21
  • Reputation Power: 3
  • Phivex has no influence.
  • Offline Offline
[ISSUE] [Solved] ImportError: No module named '_socket'
« on: September 19, 2016, 01:19:41 am »

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: [Select]
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'
« Last Edit: September 19, 2016, 09:38:07 am by Phivex »
Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 346
  • killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!
  • Offline Offline
    • DroidMonkey Apps
Re: [ISSUE] ImportError: No module named '_socket'
« Reply #1 on: September 19, 2016, 02:36:14 am »

Sockets are not supported in our build of Python for security reasons.
Logged

Phivex

  • Agent
  • *
  • Posts: 21
  • Reputation Power: 3
  • Phivex has no influence.
  • Offline Offline
Re: [ISSUE] [Solved] ImportError: No module named '_socket'
« Reply #2 on: September 19, 2016, 09:42:05 am »

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.
Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 346
  • killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!
  • Offline Offline
    • DroidMonkey Apps
Re: [ISSUE] [Solved] ImportError: No module named '_socket'
« Reply #3 on: September 20, 2016, 01:43:29 am »

hmmmmm, after looking into this it looks like we should probably include socket... I think it breaks a lot more modules then I anticipated...
« Last Edit: September 20, 2016, 01:47:05 am by killermonkey »
Logged
Pages: [1]   Go Up