tyrope / DVSaveSwitcher

Derail Valley Savegame Switcher
https://www.nexusmods.com/derailvalley/mods/127/
MIT License
1 stars 0 forks source link

Crash on Start #3

Closed averaldofh closed 3 years ago

averaldofh commented 3 years ago

I've tried the .exe option. First run ok, creates config file and closes. After that it crash right after start, with no messages. So, i tried the .py option. No success. same behaviour then I copied the code to IDLE and ran it, then i could record the errors, and this is what i get:

Traceback (most recent call last): File "C:\Users\avera\Downloads\DVSaveSwitcher-127-1-0-4-1598106261\dvss.py", line 225, in while process_exists('derailValley.exe'): File "C:\Users\avera\Downloads\DVSaveSwitcher-127-1-0-4-1598106261\dvss.py", line 197, in process_exists output = subprocess.check_output(call).decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 7: invalid start byte

I commented lines 225 to 230 and it seems to run ok. But now there's no check if the game is running. not a problem for me, but maybe could help other users if you figure out what happened. I would try, but i dont know nothing of python. :/ I'm running on windows 10, last build, python 3.9.

tyrope commented 3 years ago

Thank you for bringing this bug to my attention! Line 197 seems to be the culprit here... To quote https://github.com/joho/7XX-rfc o 732 - Fucking Unic💩de

tyrope commented 3 years ago

Uploading 1.0.5 right now, please let me know if it's not fixed!

Additionally, which language is your Windows install? I ask because it appears to not reproduce on my English machine and I'm wondering if it's a non-latin alphabet that might cause this.

averaldofh commented 3 years ago

Sorry for the late response, i downloaded 1.0.5 (from nexus), same issue, first run ok, then crash everytime. I'm using windows in PT-BR. but this time i could run the PY file from this repo with no issues. maybe something when building the .exe, or something wrong with my PC as no one else seems to have this problem

averaldofh commented 3 years ago

I used pyinstaller to build an EXE out of the PY from the last release. and now it works fine. Something is wrong with the EXE file indeed..

averaldofh commented 3 years ago

i forked the code and add an exe file if you want to try something. don't know if it helps

tyrope commented 3 years ago

Hello @averaldofh,

Sorry to hear you're still having issues. My build process is a single command, which is quite minimal: pyinstaller --onefile DVSaveSwitcher.py

Did you build using a different builder, or different parameters?

tyrope commented 3 years ago

I added some debug prints, could you try running the above commit and copy the new debug block here?

averaldofh commented 3 years ago

Sorry the late responde. I was working on a project. Actually I was learning python.. I used pyinstaller, just the same command you did. I've ran the above commit with no issues.. but I only found the .py file on the commit, the problem I was getting was with the .exe you had on the official branch.

averaldofh commented 3 years ago

and while i'm learning a bit of python, i'm now experimenting with tkinter and I'll probably make a GUI for testing. haha

tyrope commented 3 years ago

No worries about the late response! The new commit shouldn't actually fix anything, it just shows more information towards the end user. I'm hoping to learn from it too! :)

averaldofh commented 3 years ago

allright. I ran the commit again. it printed the following:

_

---- DEBUG BLOCK ---- INFORMAES: nenhuma tarefa em execuo correspondente aos critrios especificados.

especificados. ---- DEBUG ENDS ----

_

which in English means: INFORMATION: No running task corresponding to the specified criteria. [\n\n] specified.

But its running as normal. I guess there was something related to building the EXE. Some variable of the operating system must have caused an issue..but again, I'm not a programmer I'm just trying to help. :)

averaldofh commented 3 years ago

ok.. i'm getting something.. at least i think so.. i've downloaded the 1.0.4 .py and it gave me the unicode error. That was addressed in 1.0.5, BUT, do you had compiled the .exe from 1.0.5? because the downloaded exe for 1.0.5 gave me the same unicode error that before, while the .py runs smoothly. Here's the terminal output for the 104 code, the 105, and then the 105 EXE. Maybe that's why when I rerun the pyinstaller on the 1.0.5 made it work.. i dont know. but seems that isnt an script error.. maybe you just forgot? could it be the case? doesnt it make sense?

terminal

tyrope commented 3 years ago
D:\Programming\DVSaveSwitcher>pyinstaller --onefile DVSaveSwitcher.py
Traceback (most recent call last):
  File "D:\Python\Scripts\pyinstaller-script.py", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

You have succesfully located the bug! New 1.0.5 executable en-route. :)

tyrope commented 3 years ago

Resolved with v1.0.6