zakki / cgos

Computer Go Server mirror
10 stars 4 forks source link

If LogFile has no directory, the client crashes #17

Closed Remi-Coulom closed 1 year ago

Remi-Coulom commented 1 year ago

If I set something like this in the .cfg file: LogFile = common.log

The client crashes (in an infinite loop) with

Traceback (most recent call last):
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 769, in <module>
    expected = main(sys.argv[1:])
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 738, in main
    client = CGOSClient(engineConfigs,
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 128, in __init__
    os.makedirs(os.path.dirname(logFileName), exist_ok=True)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

It works if I use log/common.log instead.

zakki commented 1 year ago

Thank you.

I fixed it. https://github.com/zakki/cgos/commit/ead3761c3bc42b8bbbe0b591b4a5c7b76e4cdeb2