openube / opennero

Game platform for Artificial Intelligence research and education
Other
1 stars 0 forks source link

Error Reopening NERO Training #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run OpenNERO
2. Select NERO Training and click Start
3. After the NERO Controls load, press escape to return to the main page.
4. Select NERO Training and click Start

An infinite loop results with the 
2011-Dec-03 23:42:20.181399 (M) [python] Traceback (most recent call last):
  File "NERO/main.py", line 18, in ModTick
    data = script_server.read_data()
  File "C:\Users\utilitron\Desktop\OpenNERO\common\menu_utils.py", line 88, in read_data
    self.inputs.remove(e)
ValueError: list.remove(x): x not in list
2011-Dec-03 23:42:20.201399 (M) [python] ScriptServer socket error

Original issue reported on code.google.com by eriktash...@hotmail.com on 4 Dec 2011 at 5:50

GoogleCodeExporter commented 9 years ago

Original comment by ikarpov on 4 Dec 2011 at 6:52

GoogleCodeExporter commented 9 years ago
Same error for me, both in NERO training and battle:
 File "NERO_Battle/main.py", line 22, in ModTick
    data = script_server.read_data()

Original comment by oppili...@gmail.com on 8 Dec 2011 at 11:58

GoogleCodeExporter commented 9 years ago
This seems to be happening because of the exception handling code:

except socket.error, e:
                    print 'ScriptServer socket error'
                    self.inputs.remove(e)
                    self.outputs.remove(e)

which erroneously assumes that "e" is the socket value. Instead, socket.error 
exceptions have a string error message accompanying them, or a (errno, message) 
- in this case "e".

Attached a patch to correctly close/remove the socket "s" and log the error 
message.

Original comment by cafede...@gmail.com on 12 Dec 2011 at 4:55

Attachments:

GoogleCodeExporter commented 9 years ago
r1567 applies this patch, please verify...

Original comment by ikarpov on 12 Dec 2011 at 3:23

GoogleCodeExporter commented 9 years ago
Ok, now it works!

Original comment by oppili...@gmail.com on 15 Dec 2011 at 12:32