JonathanTaquet / Oe2sSLE

Open e2sSample.all Library Editor (Oe2sSLE) for Electribe Sampler
GNU General Public License v2.0
83 stars 20 forks source link

`UnicodeDecodeError` ? #2

Closed rknLA closed 7 years ago

rknLA commented 8 years ago

Hey, I'm trying to run this on Mac OS 10.11.4 from source, and not sure that I'm doing things correctly. I'm also running into an exception that terminates the program.

I've installed portaudio using brew install portaudio, which has let me run pip install pyaudio successfully, and I'm running the script using python Oe2sSLE_GUI.py.

At first, I clicked on Open, and navigated to the e2sSample.all file, thinking that that was the thing that I was supposed to open, selected it, then clicked on Import e2sSample.all, which seemed more likely to be the feature that I was actually looking for. Then I got the following exception log in my terminal:

(venv)rkn-mm:Oe2sSLE(master?) $ python Oe2sSLE_GUI.py                                                                                   28.03.2016 [16:43:46]
Traceback (most recent call last):
  File "Oe2sSLE_GUI.py", line 2112, in <module>
    app.mainloop()
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py", line 1131, in mainloop
    self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8f in position 0: invalid start byte

I've tried running the program again, and just clicking directly on Import e2sSample.all, but then I got a black window that didn't really allow me to do anything else, so I closed out of it.

Then, I've run it again, and just scrolled around and I see a similar exception/exit:

(venv)rkn-mm:Oe2sSLE(master?) $ python Oe2sSLE_GUI.py                                                                                       28.03.2016 [16:47:02]
Traceback (most recent call last):
  File "Oe2sSLE_GUI.py", line 2112, in <module>
    app.mainloop()
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py", line 1131, in mainloop
    self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 0: invalid continuation byte

Any ideas about how to fix this, or in general, how to get this up and working?

rknLA commented 8 years ago

It looks like I get either an invalid start byte or invalid continuation byte any time I inadvertently scroll up past the top of the text, whether it's in the main view, or in the About text view.

JonathanTaquet commented 8 years ago

Hello, thank you for your report.

I do not have a Mac, so it is difficult for me to test this code on MacOS.

It seems that you were doing correctly. I identified 2 issues related to you comment:

I performed two commits:

rknLA commented 8 years ago

Thanks for these fixes. I'm able to run the app successfully without the crashes now, but I'm running into another issue now, and that's that the window just goes mostly black (except for the corners) after I attempt to load a .all file.. Nothing shows up in the terminal, so I'm not sure what to do to attempt to debug this further

screen shot 2016-05-02 at 4 59 48 pm

rknLA commented 8 years ago

It's possible that this issue is what's mentioned on the python page for tkinter

Particularly:

If you are using OS X 10.9 Mavericks and a Python from a python.org 64-bit/32-bit installer, application windows may not update properly due to a Tk problem.

rknLA commented 8 years ago

Well, installing 8.5.18.0 didn't solve the problem, nor did installing 8.6, and the whole thing is crashing when I try to set a breakpoint inside of a UI handler. Unfortunately, I'm not sure if I know enough about tkinter to know where else to look on this one.

rknLA commented 8 years ago

Adding a sample .all file here so that I can point to it when I ask a question about this on Stack Overflow.

e2sSample.all.zip

JonathanTaquet commented 8 years ago

I think I have found the problem of the black screen. I realized that I had the same problem as you when using your file (but not using the ones I generated myself). There was a problem with character encoding of the sample name. Check commit 99a3e1a3e270e6f9034bb38ad2f7da895bc541f7 that should fix it.

JonathanTaquet commented 8 years ago

The mouse scroll seems to work properly, now. I restored it.

JonathanTaquet commented 7 years ago

The Unicode Decode Error issue is still present on some versions of MacOS when scrolling with mouse. A solution is as you pointed out, and as also detailed here: https://www.python.org/download/mac/tcltk/ to install ActiveTcl 8.5.18.0, and an official release of python (version 3.5.3 for instance) that is linking to this version of tcl/tk.