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

Crash in handle_ipc() #4

Closed
willemw12 opened this issue Jul 26, 2021 · 3 comments
Closed

Crash in handle_ipc() #4

willemw12 opened this issue Jul 26, 2021 · 3 comments

Comments

@willemw12
Copy link

Crashes since commit "use mpv IPC" on Jul 4, 2021:

Traceback (most recent call last):
  File "/usr/bin/cplay-ng", line 33, in <module>
    sys.exit(load_entry_point('cplay-ng==4.0.0', 'console_scripts', 'cplay-ng')())
  File "/usr/lib/python3.9/site-packages/cplay.py", line 818, in main
    app.run()
  File "/usr/lib/python3.9/site-packages/cplay.py", line 790, in run
    player.parse_progress()
  File "/usr/lib/python3.9/site-packages/cplay.py", line 187, in parse_progress
    self.handle_ipc(data)
  File "/usr/lib/python3.9/site-packages/cplay.py", line 173, in handle_ipc
    if data['data'] is not None and not self._seek_step:
KeyError: 'data'

Fix: change data['data'] to data.get('data') in function handle_ipc().

@xi
Copy link
Owner

xi commented Jul 26, 2021

Thanks for the report. I imagine this could be related to changes in the IPC protocol. Could you please provide the output of mpv --version?

@xi
Copy link
Owner

xi commented Jul 26, 2021

Another request: Are there steps to reproduce the issue? I tend to just apply your suggested fix, but I would like to understand the issue better.

@willemw12
Copy link
Author

Of course.

Note that in the same function in cplay-ng, get() is already used for 'event': f data.get('event'). If you do it with brackets (data['data']) you usually need to catch the AttributeError exception.

$ mpv --version
mpv 0.33.1-dirty Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100
FFmpeg version: n4.4

Ncurses 6.2.

It is on Arch Linux https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cplay-ng-git:

python setup.py install

This "devel" package builds and installs the latest commit (on the main branch). And then to reproduce the error, run:

$ cplay-ng

@xi xi closed this as completed in 9371eb7 Jul 26, 2021
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