Closed joonaskaustel closed 3 years ago
Have you tried reinstalling?
tried, same error. even with portable version
Can you see if the file music_caster.log
was created in the directory you have installed Music Caster? If so could you either upload it here or send it to me? If it does not exist let me know.
its empty :D 0kb both in the installed version and in portable dir.
That's actually a good thing because now I know what the issue is not. Okay, I added more logging so install the latest version, run it, and tell me what's in the log file this time.
download latest, installed, run, still empty log :(
Okay, two things now. First, try again with the latest version.
Second, try using tasklist /NH /FI "IMAGENAME eq Music Caster.exe"
in the command line and tell me what happens.
same result and
❯ tasklist /NH /FI "IMAGENAME eq Music Caster.exe" INFO: No tasks are running which match the specified criteria.
How about when you delete the log file and run Music Caster?
2020-11-01 19:12:27,558 INFO (2308): quit_if_running() called
Do you have Python installed? If so could you try running the following?
from subprocess import Popen, DEVNULL, PIPE
import re
import os
def get_running_processes():
# edited from https://stackoverflow.com/a/22914414/7732434
cmd = 'tasklist /NH /FI "IMAGENAME eq Music Caster.exe"'
p = Popen(cmd, shell=True, stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL)
task = p.stdout.readline()
while task != '':
task = p.stdout.readline().decode().strip()
m = re.match(r'(.+?) +(\d+) (.+?) +(\d+) +(\d+.* K).*', task)
if m is not None:
process = {'name': m.group(1), # Image name
'pid': m.group(2),
'session_name': m.group(3),
'session_num': m.group(4),
'mem_usage': m.group(5)}
yield process
def is_already_running(threshold=1 if os.path.exists('unins000.exe') else 2):
for process in get_running_processes():
process_name = process['name']
if process_name == 'Music Caster.exe':
threshold -= 1
if threshold < 0: return True
return False
if is_already_running(threshold=1):
print('Music Caster is already running')
print('CODE WORKS FINE')
❯ Python tes.py CODE WORKS FINE
Okay, I still don't know what the issue is but I did reorganize the code so that if you encounter an error in the latest version, the exception message will be sent to me.
Should be fixed in the latest update (4.71.10). It was a UnicodeDecodeError in case you are wondering what the issue was. Close this issue if it works fine.
still its not starting...
{'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:13:55.190979', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:13:40.704977', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:12:13.111301', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'} {'EXCEPTION TYPE': 'UnicodeDecodeError', 'FATAL': True, 'LINE': 2336, 'LOG': [], 'MAC': 'd8:cb:8a:31:91:05', 'OS': 'Windows-10-10.0.18362-SP0', 'PLAYING_TYPE': 'none', 'TIME': '2020-11-04 18:11:25.563060', 'TRACEBACK': 'Traceback (most recent call last):\n' ' File "music_caster.py", line 2336, in <module>\n' ' File "helpers.py", line 160, in is_already_running\n' ' File "helpers.py", line 151, in get_running_processes\n' "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in " 'position 70: invalid start byte\n', 'VERSION': '4.71.10'}
shows up in task manager for few seconds and then quits
Ok check out the latest update.
started now, thanks!