hgabor47
Hi, 
I'm newbee in PLC world.
I would like to install the OPENPLC EDITOR but not work for me.
I have a Windows 11 OS.
I squeezed it out of him a long error message:

 
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 10: invalid continuation byte
Traceback (most recent call last):
  File "C:\Users\Gábor\OpenPLC_Editor\python\lib\site-packages\wx-3.0-msw\wx\_core.py", line 16766, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File ".\editor\Beremiz.py", line 211, in AppStart
    self.handle_exception(*sys.exc_info(), exit=True)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 140, in handle_exception
    save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 115, in save_bug_report
    info['locals'] = format_namespace(exception_locals)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 90, in format_namespace
    return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()])
  File "C:\Users\Gábor\OpenPLC_Editor\python\lib\site-packages\matplotlib\font_manager.py", line 395, in __repr__
    self.name, os.path.basename(self.fname), self.style, self.variant,
AttributeError: 'NoneType' object has no attribute 'path'
Error in sys.excepthook:
Traceback (most recent call last):
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 140, in handle_exception
    save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 115, in save_bug_report
    info['locals'] = format_namespace(exception_locals)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 90, in format_namespace
    return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()])
  File "C:\Users\Gábor\OpenPLC_Editor\python\lib\site-packages\matplotlib\font_manager.py", line 395, in __repr__
    self.name, os.path.basename(self.fname), self.style, self.variant,
AttributeError: 'NoneType' object has no attribute 'path'
 
Original exception was:
Traceback (most recent call last):
  File "C:\Users\Gábor\OpenPLC_Editor\python\lib\site-packages\wx-3.0-msw\wx\_core.py", line 16766, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File ".\editor\Beremiz.py", line 211, in AppStart
    self.handle_exception(*sys.exc_info(), exit=True)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 140, in handle_exception
    save_bug_report(e_type, e_value, e_traceback, bug_report_path, date)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 115, in save_bug_report
    info['locals'] = format_namespace(exception_locals)
  File "C:\Users\Gábor\OpenPLC_Editor\editor\util\ExceptionHandler.py", line 90, in format_namespace
    return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()])
  File "C:\Users\Gábor\OpenPLC_Editor\python\lib\site-packages\matplotlib\font_manager.py", line 395, in __repr__
    self.name, os.path.basename(self.fname), self.style, self.variant,
AttributeError: 'NoneType' object has no attribute 'path'

So i have no succes with my first exprecience.
if I download a software I think I don't need helper for install it normally. 
 
 
Please help me. 😃 😃
Gabor
thiagoralves
It looks like there is a bug related to Unicode characters in your user name (Gábor). Try moving the C:\Users\Gábor\OpenPLC_Editor folder to C:\OpenPLC_Editor and run it from there to see if it works
Reply 0 0
hgabor47
Very thanks.
I tried and this is  a solution. I have an another Gabi account and working like a charm.
Gabor
Reply 0 0
hgabor47
I found a problem in BUILD for PLCs and I repaired the problem in arduino/builder.py : setLangArduino.
Thi is the modified function and this is working well in unicode path

def setLangArduino():
    cli_command = ''
    if os_platform.system() == 'Windows':
        cli_command = 'editor\\arduino\\bin\\arduino-cli-w32'
    elif os_platform.system() == 'Darwin':
        cli_command = 'editor/arduino/bin/arduino-cli-mac'
    else:
        cli_command = 'editor/arduino/bin/arduino-cli-l64'

    # Initialize arduino-cli config - if it hasn't been initialized yet
    runCommand(cli_command + ' config init')
   
    dump = runCommand(cli_command + ' config dump')
    dump = dump.splitlines()
    arduino_dir = ''
    for line in dump:
        if "data:" in line:
            arduino_dir = line.split('data:')[1]
            arduino_dir = ''.join(arduino_dir.split()) #remove white spaces

    arduino_dir = os.path.normpath(arduino_dir) # Normalize the path

    for line in dump:
        if "locale:" in line:
            if "en" not in line:
                dump.remove(line)
            else:
                return
               
    dump.append('locale: en')
    dump = '\n'.join(dump)
   
    with io.open(arduino_dir + '/arduino-cli.yaml', 'w', encoding='utf-8') as f:
        f.write(unicode(dump))
Reply 0 0
thiagoralves
Just update your editor and you won’t have that problem anymore 
Reply 0 0
hgabor47
Thanks !!!
Reply 0 0
Reply