Closed Serranya closed 10 years ago
Are you using Python 3, by chance ? It's not supported yet, unfortunately.
Yes, im using Python 3.4.1
Great, I'll work on that. Meanwhile, I guess you will have to stick to 2.6-2.7
I've pushed initial support, you can test with :
$ git clone http://github.com/gapato/livestreamer-curses/
$ cd livestreamer-curses
$ git checkout python3
$ sudo python setup.py install # or wherever your python3 interpreter is
and report back.
It installed without a problem. I also added a stream, and played it. No problems so far :+1:
Ok i found a way to crash it again. The Crash is reproducible: Start livestreamer-curses filter by a random string unset filter press o
If have CHECK_ONLINE_ON_START = True
in my .livestreamer-cursesrc and all streams where offline at the time of testing
The Error i get is:
Traceback (most recent call last):
File "/usr/bin/livestreamer-curses", line 9, in <module>
load_entry_point('livestreamer-curses==1.1.0', 'console_scripts', 'livestreamer-curses')()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 908, in main
curses.wrapper(l)
File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 221, in __call__
self.run()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 361, in run
self.refilter_streams()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 728, in refilter_streams
and (self.filter in s['name'].lower() or self.filter in s['url'].lower())):
TypeError: 'in <string>' requires string as left operand, not NoneType
And another crash with the same setting as above e.g
CHECK_ONLINE_ON_START = True
and no streams are online.
Also reproducible
open livestreamer-curses
press a
enter url
press enter
Traceback (most recent call last):
File "/usr/bin/livestreamer-curses", line 9, in <module>
load_entry_point('livestreamer-curses==1.1.0', 'console_scripts', 'livestreamer-curses')()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 908, in main
curses.wrapper(l)
File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 221, in __call__
self.run()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 356, in run
self.prompt_new_stream()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 853, in prompt_new_stream
self.add_stream(name, url)
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 762, in add_stream
for (k,v) in s_res.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
It looks like the first error is not Python 3 specific, and the second definitely is. I'll look into it, thank you for your reports!
dict.iteritems
was renamed to dict.items
. if you want the old items, you need to list(dict.items())
(but you don't)
Is there an alternative to list(dict.items())
if I want to keep 2.x compatiblity, which I do ?
I've pushed a couple of fixes, it should work better now. Writing Python 2/3 compatible code is horrible, fwiw.
Great, all the problems i reported are now gone :)
But i found already the next problem :D
If i maximize the window of my terminal, i get the following
Traceback (most recent call last):
File "/usr/bin/livestreamer-curses", line 9, in <module>
load_entry_point('livestreamer-curses==1.1.0', 'console_scripts', 'livestreamer-curses')()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 925, in main
curses.wrapper(l)
File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 238, in __call__
self.run()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 315, in run
(r, w, x) = select.select(souts, [], [], 1)
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 296, in resize
self.move(stream_cursor, absolute=True, pad_name='streams')
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 570, in move
self.refresh_current_pad()
File "/usr/lib/python3.4/site-packages/livestreamer_curses/main.py", line 505, in refresh_current_pad
pad.refresh(self.offsets[self.current_pad], 0, 2, self.pad_x, self.pad_h, self.pad_w)
_curses.error: prefresh() returned ERR
Im using XFCE 4.10 with the default terminal and windowmanager.
I have the same issue, it not easy to trigger however. Could you open a separate issue ?
I have opened Issue https://github.com/gapato/livestreamer-curses/issues/4.
Ok, I will leave this issue open for a few days in case some other bug crops up, and if not I'll merge into master.
Hello im getting the following error with version 1.1.0:
I dont know any python, but i think the cmd string should be quoted.