Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'unicode' is not defined #14

Closed
FirstLoveLife opened this issue Jul 4, 2018 · 6 comments
Closed

NameError: name 'unicode' is not defined #14

FirstLoveLife opened this issue Jul 4, 2018 · 6 comments

Comments

@FirstLoveLife
Copy link
Contributor

FirstLoveLife commented Jul 4, 2018

Environment

archlinux 福 ~/.emacs.d/elisp 
6620 ◯ : emacs --version                                                                                                                    
GNU Emacs 26.1
Linux archlinux 4.14.21-1-MANJARO #1 SMP PREEMPT Fri Feb 23 00:01:40 UTC 2018 x86_64 GNU/Linux

install

sudo pacman -S python-xlib python-pyqt5 python-pymediainfo has no problem.

archlinux 福 ~/.emacs.d/elisp 
6625 ◯ : sudo pip install PyMuPDF                                                                                                         ⏎ 

Requirement already satisfied: PyMuPDF in /usr/lib/python3.6/site-packages (1.13.11)
picard 2.0.0.dev7 requires PyQt5, which is not installed.

M-x eaf-open

In minbuffer, I type my path to pdf file

user-error: Minibuffer window is not active
Quit
Type C-w C-o to delete the help window, C-M-v to scroll help.
evil-forward-char: End of buffer [4 times]
helm-M-x: D-Bus error: "Traceback (most recent call last):
  File \"/usr/lib/python3.6/site-packages/dbus/service.py\", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File \"/home/czxyl/.emacs.d/elisp/emacs-application-framework/eaf.py\", line 65, in new_buffer
    return self.create_app(buffer_id, url, \"app.pdfviewer.buffer\")
  File \"/home/czxyl/.emacs.d/elisp/emacs-application-framework/eaf.py\", line 92, in create_app
    self.create_buffer(buffer_id, module.AppBuffer(buffer_id, url))
  File \"/home/czxyl/.emacs.d/elisp/emacs-application-framework/app/pdfviewer/buffer.py\", line 34, in __init__
    self.add_widget(PdfViewerWidget(url, QColor(0, 0, 0, 255)))
  File \"/home/czxyl/.emacs.d/elisp/emacs-application-framework/app/pdfviewer/buffer.py\", line 54, in __init__
    self.document = fitz.open(url)
  File \"/usr/lib/python3.6/site-packages/fitz/fitz.py\", line 628, in __init__
    elif type(filename) == unicode:
NameError: name 'unicode' is not defined
"
Quit [2 times]

Above is Messages buffer output.

How can I fix this?

BTW, image view and videw player work fine

@manateelazycat
Copy link
Member

Can you give me your pdf file name?

I will test what's wrong.

Thanks report!

@FirstLoveLife
Copy link
Contributor Author

@manateelazycat All my pdf files will report the errors.

peek 2018-07-04 11-43

@manateelazycat
Copy link
Member

@FirstLoveLife I know, i mean can you give me your pdf, let me test it ?

@FirstLoveLife
Copy link
Contributor Author

Sure: https://www.cs.cmu.edu/~410/self.pdf
I use eaf to open this file originally.

@manateelazycat
Copy link
Member

@FirstLoveLife I have test, works fine for me.

You can try below method:

  1. Start emacs with command "emacs -Q", then load eaf test again.

If Emacs -Q works fine, it's must be something wrong in your Emacs config.

  1. M-x ielm RET
    Execute (setenv "LANG" "en_US.UTF-8") in ielm, then test again.
    If setenv can work, you need set your system LANG env to make support unicode filename

@FirstLoveLife
Copy link
Contributor Author

Thanks! I even forgot to use -Q. MY BAD!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants