bjarneo / Pytify

A CLI application for controlling Spotify
MIT License
741 stars 40 forks source link

Crashing after 'search' #45

Closed darnassiano closed 7 years ago

darnassiano commented 7 years ago

After searching I get the following error message:

'tracks' Traceback (most recent call last): File "/usr/local/bin/pytify", line 11, in load_entry_point('pytify==3.3.2', 'console_scripts', 'pytify')() File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/cli.py", line 85, in main File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/cli.py", line 19, in init File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/cli.py", line 61, in run File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/cli.py", line 80, in interaction File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/cli.py", line 22, in list_songs File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/song_list.py", line 37, in init File "/usr/lib/python3.5/curses/init.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/usr/local/lib/python3.5/dist-packages/pytify-3.3.2-py3.5.egg/pytify/song_list.py", line 79, in display _curses.error: addwstr() returned ERR

And pytify stops...

I looked at some help with this 'addwstr() ERR' and found that might be an issue with libncurses5 or libncursesw5 dependencies. I upgraded both (tried reinstalling only one or both, simlink etc etc) but it not worked at all

Do somebody can help me?

bjarneo commented 7 years ago

I was able to reproduce this. I read somewhere that if the terminal window is to small for the output (in curses) it will throw an error. Try to expand the terminal, reset, then run pytify. Did that help?

Need to solve this somehow.

bjarneo commented 7 years ago

Terminal window must be at least 100x30

bjarneo commented 7 years ago

This PR will notify the user if the terminal window is to small https://github.com/bjarneo/Pytify/pull/46 Updated commit: https://github.com/bjarneo/Pytify/commit/d2a84ac3433cbaff1a255bf7869cf9700fda8153

However, I don't think it is the final solution.

  1. Resize the window for the user? Or is that annoying?
  2. Remove some height (keyboard shortcuts) from the songlist? Remove some width?
  3. Keep it as is?
darnassiano commented 7 years ago

captura de pantalla de 2016-12-14 17-00-22 Running with > 100x30 size.

bjarneo commented 7 years ago

@darnassiano what is the output if you type python --version ?

Shebang used in cli.py (the entrypoint) is #!/usr/bin/env python. So you might be using python2 as default. Which means I should update #!/usr/bin/env python to python3

Thanks for letting me know the errors :)

darnassiano commented 7 years ago

Now works! :) hehe

bjarneo commented 7 years ago

@darnassiano Good to hear :)

This should solve the issue, so it targets python3 https://github.com/bjarneo/Pytify/commit/ed2ba5dadb5f416b7ad84b7ad3e846ca505b9547