athrvvvv/AppOpener

Weird character errors

merksk8 opened this issue · 9 comments

Hi!

I'm a little newbie with python, so this may be something that I'm doing wrong, but here's the problem:

When running LS, the application names shows like this:

  1. S P O T I F Y C U S E R S M E R K A P P D A T A R O A M I N G S P O T I F Y S P O T I F Y E X E

And then, when executing this code:

from AppOpener import run

run("ls")

run("spotify")

it responds:

SPOTIFY NOT FOUND... TYPE (LS) for list of applications.

So for what I see, it works well, it's just messing with the characters, encoding, or something like that.

Running it from VS Code console (tried in Powershell but same error), versions are:

  • AppOpener 1.1
  • Python 3.8.10
  • Windows 10
  • Windows in spanish ( just in case has something to do with it )

Thanks for your help, if you need any more info or you know what i'm doing wrong, please tell me!

Edit: code had "spotify.exe" because tried also this way, but neither "spotify" or "spotify.exe" never worked

is this problem only occurring for spotify?

No, happens with all programs. All with same spacing between letters in the list ( not shure if that's normal or not ), and none of them working when trying to run them. Any tip?

Trying to investigate the issue, found this, for if helps!

reference.txt, all rows appear to be correct:

Spotify C:\Users\Merk\AppData\Roaming\Spotify\Spotify.exe

in reference.txt, special characters appears OK, examples like this:

TM from "PlaystationNow", and accent in "Documentación"

PlayStation™Now F:\Program Files\PSNow\psnowlauncher.exe
Documentación de Referencia https://docs.oracle.com/javase/17/docs

data.json file, all rows appear like this:

"s p o t i f y c u s e r s m e r k a p p d a t a r o a m i n g s p o t i f y s p o t i f y e x e": "\u0000",

app_names.json appears like this:

"s p o t i f y c u s e r s m e r k a p p d a t a r o a m i n g s p o t i f y s p o t i f y e x e": "",

and when trying to run command "update", this happens:

FETCHING ALL NEW APPS (if any)
Traceback (most recent call last):
  File "e:/IA/SPEECH/test.py", line 4, in <module>
    run("update")
  File "E:\Python\lib\site-packages\AppOpener\__init__.py", line 98, in run
    update_list.update()   
  File "E:\Python\lib\site-packages\AppOpener\update_list.py", line 235, in update
    lines2 = str(lines).encode().decode("utf-16le")
  File "E:\Python\lib\encodings\utf_16_le.py", line 16, in decode
    return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 104272: truncated data

I hope this helps a little, if you need more info just tell me! And anyway I will try to keep testing things to see if I can provide more information, thanks again!!

thanks for additional information. iam working on this... if you find any solution just pull request it.

cheers,
athrv.

Created pull request #2 that I think fixes the issue (at least in my computer), first time doing a pull request so if I did something wrong please tell me! Thanks! :)

Absolutely fantastic work!! this makes AppOpener more faster.
as you mentioned in your first comment, "you are newbie in python" but you don't seem to be newbie 🤗
I have invited you in our testing program Flaky Community.

Note: AppOpener version 1.2 will released soon..

hello there! please make a pull request again, because of an certain reason everything got messed.

Hey there, with the release of AppOpener v1.3 this issue must have been fixed.

Install AppOpener v1.3 as follows

pip install AppOpener==1.3

Also, for additional information you may visit documentation here.

Note: If your issue is fixed you may close the issue now.

Apart from topic, I want to ask you how did you reached AppOpener?? (ex. twitter, stackoverflow, ect.)

cheers,
athrv.

Hello,

Version 1.3 works perfect now in a fresh install ( deleted all previous version files) and also "update" function works perfect, thank you very much!

I found this repo in an answer in stackoverflow. Someone was looking for the same thing as me: a way to open a program without knowing the full path.

Thanks again and reach me if you need any more information or anything!