obsidian-execute-code icon indicating copy to clipboard operation
obsidian-execute-code copied to clipboard

[BUG] unrecoverable cp949 error if path includes unicode

Open Argoneon1810 opened this issue 1 year ago • 0 comments

Prior to proceeding into the contents, sorry if this issue is duplicate or out of the scope of this plug-in. I dug into the issues tab, and tried to find whether this is a known bug or not, and whether if you are planning to fix it or not. The result was nothing, at least on my own trial, so I posted this issue. If it is duplicate, I apologize.

Describe the bug If path includes unicode (such as Korean in my case), cp949 error occurs which is unrecoverable until restarting Obsidian.

Software Version OS: Windows 10 Home 22H2 Plugin Ver: 1.12.0 Obsidian Ver: 1.6.7

To Reproduce

  1. write any python script in executable codeblock
  2. put any korean letter in that code. can be in string, can be in comment, anywhere
  3. click run
  4. crash

Expected behavior Code should work with no problem, as python is capable of processing unicode

Screenshots

https://github.com/user-attachments/assets/c3eafbb5-c621-41a0-92f6-996b0709cb4f

https://github.com/user-attachments/assets/6cc2a1eb-723d-4038-af15-525dbc0fde3b

Stacktrace

  File "<stdin>", line 3
    __print_06455586455591611_1722411573860(eval(
                                                 ^
SyntaxError: (unicode error) 'cp949' codec can't decode byte 0xb0 in position 277: illegal multibyte sequence
>>>   File "<stdin>", line 1
    __globals_4407305385591691_1722411573860
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    ))
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    except SyntaxError:
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    exec(
IndentationError: unexpected indent
>>>   File "<stdin>", line 0
    
SyntaxError: (unicode error) 'cp949' codec can't decode byte 0xb0 in position 277: illegal multibyte sequence
>>>   File "<stdin>", line 1
    __globals_4407305385591691_1722411573860
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    )
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    except Exception as e:
    ^^^^^^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
    __print_06455586455591611_1722411573860 (e, file=sys.stderr)
IndentationError: unexpected indent
>>>   File "<stdin>", line 1
    finally:
    ^^^^^^^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
    __print_06455586455591611_1722411573860 ("SIGIL_BLOCK_DONE_0.8205521747857321_1722411879044_237", end="")
IndentationError: unexpected indent

Argoneon1810 avatar Jul 31 '24 07:07 Argoneon1810