New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ValueError: I/O operation on closed file." when exiting UH started with "--debug" #2681

Open
squiddy opened this Issue May 17, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@squiddy
Member

squiddy commented May 17, 2017

Steps to reproduce

  1. $ python run_uh.py --debug
    ... lots of messages appearing ...
  2. Exit the game via the menu
  3. Game stops, exception is raised:
Thank you for using Unknown Horizons!Traceback (most recent call last):
  File "run_uh.py", line 382, in <module>
    main()
  File "run_uh.py", line 211, in main
    print(T('Thank you for using Unknown Horizons!'))
  File "run_uh.py", line 263, in write
    logfile.write(line)
ValueError: I/O operation on closed file.

Error in sys.excepthook:
Traceback (most recent call last):
  File "run_uh.py", line 120, in excepthook
    print('\n', T('Unknown Horizons has crashed.'), '\n')
  File "run_uh.py", line 263, in write
    logfile.write(line)
ValueError: I/O operation on closed file.

Original exception was:
Traceback (most recent call last):
  File "run_uh.py", line 382, in <module>
    main()
  File "run_uh.py", line 211, in main
    print(T('Thank you for using Unknown Horizons!'))
  File "run_uh.py", line 263, in write
    logfile.write(line)
ValueError: I/O operation on closed file.
Exception ignored in: <__main__.setup_debugging.<locals>.StdOutDuplicator object at 0x7f884bfe4f28>
Traceback (most recent call last):
  File "run_uh.py", line 266, in flush
    logfile.flush()
ValueError: I/O operation on closed file.
@AndyMender

This comment has been minimized.

Show comment
Hide comment
@AndyMender

AndyMender May 18, 2017

Member

Did the debug mode work properly previously? I might have a look at this.

Member

AndyMender commented May 18, 2017

Did the debug mode work properly previously? I might have a look at this.

@squiddy

This comment has been minimized.

Show comment
Hide comment
@squiddy

squiddy May 18, 2017

Member

No clue, haven't used it in a while. The logging still works fine though, it's just that there are exception raised when closing the game. Minor issue really.

Member

squiddy commented May 18, 2017

No clue, haven't used it in a while. The logging still works fine though, it's just that there are exception raised when closing the game. Minor issue really.

@squiddy squiddy self-assigned this May 21, 2017

@squiddy

This comment has been minimized.

Show comment
Hide comment
@squiddy

squiddy May 21, 2017

Member

Going to have a look at it. Log handling in the run_uh.py file looks a bit messy.

Member

squiddy commented May 21, 2017

Going to have a look at it. Log handling in the run_uh.py file looks a bit messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment