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

[BUG] AttributeError: NoneType object has no attribute page #240

Closed
nivit opened this issue May 3, 2024 · 3 comments
Closed

[BUG] AttributeError: NoneType object has no attribute page #240

nivit opened this issue May 3, 2024 · 3 comments

Comments

@nivit
Copy link

nivit commented May 3, 2024

Describe the bug

Pyradio exits with this Traceback:

Reading playlist...
Traceback (most recent call last):
  File "/usr/local/bin/pyradio", line 8, in <module>
    sys.exit(shell())
  File "/usr/local/lib/python3.9/site-packages/pyradio/main.py", line 924, in shell
    curses.wrapper(pyradio.setup)
  File "/usr/local/lib/python3.9/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 1068, in setup
    self.run()
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 1947, in run
    ret = self.keypress(c)
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 8075, in keypress
    ret = self.saveCurrentPlaylist()
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 2502, in saveCurrentPlaylist
    self.refreshBody()
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 1349, in refreshBody
    self._redisplay[self._redisplay_list[n][0]]()
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 9644, in _redisplay_stations_and_playlists
    self._print_body_header()
  File "/usr/local/lib/python3.9/site-packages/pyradio/radio.py", line 1482, in _print_body_header
    if self._cnf._online_browser.page > 0:
AttributeError: NoneType object has no attribute page

moving a radio up or down the stations list, and then trying to access to the Radio Browser.

How To Reproduce

Steps to reproduce the behavior:

  1. Move the cursor on a station in the list
  2. Press ^u or ^d, then O (to go to the Radio Browser)
  3. The window Playlist Modified pops up, press y to confirm
  4. Pyradio exists with that error.

Expected behavior

Save the modified list, and then go to the Radio Browser...

System:

  • OS: FreeBSD-14.0-RELEASE
  • Python version: 3.9.18
  • PyRadio Version: 0.9.3.4
  • Player used: mpv
@s-n-g
Copy link
Collaborator

s-n-g commented May 3, 2024

Hi @nivit

fixed in devel

If you wanto to test it, please edit /usr/local/lib/python3.9/site-packages/pyradio/radio.py, line 1481

and change

if self._cnf.browsing_station_service:

to

if self._cnf._online_browser:

@nivit
Copy link
Author

nivit commented May 3, 2024

It works fine. Thank you!

@s-n-g
Copy link
Collaborator

s-n-g commented May 6, 2024

fixed in 0.9.3.5

@s-n-g s-n-g closed this as completed May 6, 2024
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