pnprog / goreviewpartner

A tool to help analyse and review your game of go (weiqi, baduk) using strong bots.
GNU General Public License v3.0
283 stars 66 forks source link

SGF fails to load with non-English characters in file path #90

Open DrewHeath opened 6 years ago

DrewHeath commented 6 years ago

Easily reproduceable.

My SGF path was

C:/Users/AndrewHeath/Desktop/围棋/JZFCDJEBYW.sgf

the 围棋 caused GRP to choke. Moving the SGF to a location with no Chinese in the path solved the problem.

CMD log follows:

filename: C:/Users/AndrewHeath/Desktop/??/JZFCDJEBYW.sgf
Could not open the SGF file C:/Users/AndrewHeath/Desktop/??/JZFCDJEBYW.sgf
=> 22 invalid mode ('r') or filename
converting GRPException error message from unicode to str
Exception in Tkinter callback
Traceback (most recent call last):
  File "Tkinter.pyc", line 1532, in __call__
  File "main.py", line 109, in launch_analysis
  File "toolbox.pyc", line 438, in __init__
  File "toolbox.pyc", line 339, in open_sgf
GRPException: Could not open the RSGF file: C:/Users/AndrewHeath/Desktop/围棋/JZFCDJEBYW.sgf
invalid mode ('r') or filename
Removing popup
Exception in Tkinter callback
Traceback (most recent call last):
  File "Tkinter.pyc", line 1532, in __call__
  File "toolbox.pyc", line 628, in close
  File "toolbox.pyc", line 2012, in remove_popup
ValueError: list.remove(x): x not in list
Initializing GRP setting interface
Adding new popup
Totally 2 popups
Initializing Leela setting interface
Initializing LeelaZero setting interface
Initializing GRP setting interface
closing popup
Removing popup
Totally 1 popups left
done
pnprog commented 6 years ago

Hi @DrewHeath ,

Thanks for reporting the issue. I guess this is the same problem as https://github.com/pnprog/goreviewpartner/issues/84

Can you provide the first 4 lines that appear in the terminal windows? On my computer they are:

(u'STDIN encoding:', 'UTF-8')
(u'STDOUT encoding:', 'UTF-8')
(u'STDERR encoding:', 'UTF-8')
(u'File system encoding:', 'UTF-8')

I need to check what sort of encoding is used on your computer.

Thanks!

pnprog commented 6 years ago

Hi! I made a quick change that should make it work now (https://github.com/pnprog/goreviewpartner/commit/23568d24098d44e489e39292ebae4257ce87e70d) If you have the possibility, can you try to run the latest sources and check if it's working?