Mostafa-wael / Quran-cli

A simple command line interface for listening to Quran.

Home Page:https://www.npmjs.com/package/@quran-cli/q-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Process Exit With Exception

We2Am-BaSsem opened this issue · comments

Steps to reproduce

  1. Open the project directory
  2. Open a terminal in the project directory
  3. Run command python3 quran_cli.py -rd 0 in terminal
  4. Wait until the radio works
  5. press CTRL + C to kill the process

Expected behaviour (correct)

The process should be safely(exited without exception)

Current behaviour (bug)

Exit with Exception

Environment

ubuntu 22.04

Relevant logs and/or media (optional)

Write here or upload an image/video
Radio Name:  ---Amazing short Recitations---
 (+) Audio --aid=1 (mp3 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
A: 00:00:01 / 00:00:13 (8%) Cache: 11s/408KB
File tags:
 icy-title: 339-محمد حكمي - نرفع درجات من نشاء
A: 00:00:03 / 00:00:19 (20%) Cache: 15s/552KB

Exiting... (Quit)
Traceback (most recent call last):
  File "/home/we2am/Desktop/Github/Quran-cli/quran_cli.py", line 24, in <module>
    radioMode(radioIndex)
  File "/home/we2am/Desktop/Github/Quran-cli/modes/radioMode.py", line 86, in radioMode
    runRadio(radioIndex)
  File "/home/we2am/Desktop/Github/Quran-cli/modes/radioMode.py", line 70, in runRadio
    runFromURL(getRadioURL(radioIndex))
  File "/home/we2am/Desktop/Github/Quran-cli/utilities/helperFunctions.py", line 38, in runFromURL
    subprocess.call(["mpv", url])
  File "/usr/lib/python3.10/subprocess.py", line 347, in call
    return p.wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1204, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1938, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.10/subprocess.py", line 1896, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

image

Root Cause Analysis

the audio player was displayed and closing the process was causing exceptions due to closing the player

Other Comments

solved in issue commit: remove audio diplay

It's fixed now @We2Am-BaSsem <3
Thanks a lot ^_^