terminal_markdown_viewer icon indicating copy to clipboard operation
terminal_markdown_viewer copied to clipboard

NameError: name 'unichr' is not defined

Open ryan-gi opened this issue 6 years ago • 7 comments

unichr error has returned.

$:mdv --help

Output:

Option parsing error

...

File "/usr/local/Cellar/mdv/1.6.3_1/libexec/lib/python3.7/site-packages/mdv/markdownviewer.py", line 624, in replace_links cur += '%s ' % unichr(link_start_ord + cur_link) NameError: name 'unichr' is not defined

ryan-gi avatar Dec 07 '18 23:12 ryan-gi

In Python 3 unichr is not defined. chr should be used instead. https://stackoverflow.com/a/2352047/2227405

rodrigobdz avatar Jan 13 '19 13:01 rodrigobdz

That should be cover avoided by this check but I'm getting the same error. https://github.com/axiros/terminal_markdown_viewer/blob/80f333ba51dc2f1dfa854e203d3374a112aecbd3/mdv/markdownviewer.py#L346-L347

rodrigobdz avatar Jan 13 '19 13:01 rodrigobdz

I just got this error:
File "/usr/local/Cellar/mdv/1.6.3_1/libexec/lib/python3.7/site-packages/mdv/markdownviewer.py", line 624, in replace_links cur += '%s ' % unichr(link_start_ord + cur_link)

  • deleted and reinstalled and still broken
  • change unichr to char, ie vim, and all worked

ms4720 avatar Jan 21 '19 05:01 ms4720

according to rg unichr /usr/local/Cellar/mdv/1.6.3_1/libexec/lib/python3.7/site-packages/mdv the one instance I edited was the only instance there, one change and 0 other hits. maybe a release would fix this

ms4720 avatar Jan 21 '19 05:01 ms4720

rg unichr /usr/local/Cellar/mdv/1.6.3_1/libexec/lib/python3.7/site-packages/mdv

@ms4720 What is rg?

rodrigobdz avatar Jan 21 '19 08:01 rodrigobdz

Rust grep I think, enhanced look through a directory tree of files grep

Brew info rg will get you the home page on a mac

ms4720 avatar Jan 21 '19 13:01 ms4720

rg = ripgrep (BurntSushi/ripgrep)

haakonstorm avatar May 08 '20 15:05 haakonstorm

released, should be fixed.

axgkl avatar Oct 02 '23 22:10 axgkl