HaveF/opennero

Error Reopening NERO Training

GoogleCodeExporter opened this issue · 5 comments

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

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

  • Added labels: ****
  • Removed labels: ****

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

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****
r1567 applies this patch, please verify...

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

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****
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

  • Added labels: ****
  • Removed labels: ****

Attachments:

Ok, now it works!

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

  • Added labels: ****
  • Removed labels: ****