GoldenEye: Source Forums

  • November 15, 2018, 11:45:03 PM
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: [ISSUE] [Solved] ImportError: No module named '_socket'  (Read 2889 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 18, 2016, 02:19:41 PM »

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 18, 2016, 10:38:07 PM by Phivex »
Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 327
  • 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 18, 2016, 03:36:14 PM »

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 18, 2016, 10:42:05 PM »

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: 327
  • 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 19, 2016, 02:43:29 PM »

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 19, 2016, 02:47:05 PM by killermonkey »
Logged
Pages: [1]   Go Up