shlomif / PySolFC

A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
http://pysolfc.sourceforge.net/
GNU General Public License v3.0
456 stars 100 forks source link

Windows 10 some options windows hang #226

Closed Nebula-Mechanica closed 2 years ago

Nebula-Mechanica commented 3 years ago

Installed game from official Windows installer, hangs when trying to select cardsets. Sorry, haven't found where logs are to attach. If I close this blank window, game window also closes.

Снимок экрана 2021-10-02 223745

joeraz commented 3 years ago

I just attempted this on Windows 10 with 2.14, and was not able to reproduce the error.

Do you have any extra cardsets installed? A bad cardset can cause issues with the cardsets selector.

Could you check if there are any logs in the PySolFC install directory, or in your user folder, C:\Users[User]\AppData\Roaming\PySolFC? If not, could you try reproducing the error while running PySol as an admin, which might create some extra files that couldn't be created otherwise?

Nebula-Mechanica commented 3 years ago

Do you have any extra cardsets installed? A bad cardset can cause issues with the cardsets selector.

No, just installed the game for the first time.

Could you check if there are any logs in the PySolFC install directory, or in your user folder, C:\Users[User]\AppData\Roaming\PySolFC?

No, I don't see any log files there

If not, could you try reproducing the error while running PySol as an admin, which might create some extra files that couldn't be created otherwise?

I tried, running as admin did not help. Also setting language to "en" in config file did not.

joeraz commented 3 years ago

Hmm...

Could you send me a copy of your config file?

cardset commented 3 years ago

Same on Windows 8.1

and also options/table tile crashes.

You can play games, if you minimize the small window

joeraz commented 3 years ago

I just tested on a second Windows computer. I also tried wiping and reinstalling PySol, along with my local data, and still couldn't reproduce the issue described here. The fact that it affects the table tile window too might be a clue. I know I made a few changes to both windows due to cutoff when displaying higher resolution cards and consistency in the display.

Could you tell me what screen resolution you're using? Also, does this issue affect the select game window as well?

cardset commented 3 years ago

Screen resolution is: 1920*1080

It affects: Select / All games

The others in "Select" work, or end with exit because of incompatible cardset (for example all Majong)

joeraz commented 3 years ago

Hmm... The incompatible cardset error should only occur when starting a new game if a cardset was deleted or was set using an older version (pre-2.12) of PySol that allowed that. Something might be off in your options.cfg file. Could you try deleting or renaming it to see if this changes anything?

Also, kind of grasping at straws (still can't reproduce), but would either of you be able to test using the version of the code in this branch: https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize and let me know if that resolves the issue?

Nebula-Mechanica commented 3 years ago

Hmm...

Could you send me a copy of your config file?

Nothing special in there, same after wipe.

https://gist.github.com/Nebula-Mechanica/c70464a523b077a8c943dab45263febb

I confirm @cardset's problem with Select / All games, and Options / Table tile, though Mahjong games work for me. Also 1920x1080. Using scaling on a laptop, tried to disable scaling for PySolFC and systemwide, nothing changed about hangs.

Nebula-Mechanica commented 3 years ago

Also, kind of grasping at straws (still can't reproduce), but would either of you be able to test using the version of the code in this branch: https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize and let me know if that resolves the issue?

Is it possible to get binary build of this branch or clear instructions for building on Windows?

joeraz commented 3 years ago

Also, kind of grasping at straws (still can't reproduce), but would either of you be able to test using the version of the code in this branch: https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize and let me know if that resolves the issue?

Is it possible to get binary build of this branch or clear instructions for building on Windows?

Download an installer here: https://ci.appveyor.com/project/shlomif/pysolfc/builds/41031870/artifacts

Nebula-Mechanica commented 3 years ago

Thanks, I tried this build and unfortunately it's still the same problem. Will try if it reproduses on office PC tomorrow.

cardset commented 3 years ago

Also, kind of grasping at straws (still can't reproduce), but would either of you be able to test using the version of the code in this branch: https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize and let me know if that resolves the issue?

Maybe i find time at the weekend to install a recent Python Version.

Just want to say I have no problem to start Pysol with a 336 * 510 custom card set . Only changing the card set causes problems.

Nebula-Mechanica commented 3 years ago

To make it clear, I tried previous versions now. The problem is still there on 2.12.0, but 2.10.1 works fine. So it's some change after 2.10.1.

How is game actually debugged, are there any logs that are hidden in release version? I feel I could help, but now it's just blind guesses.

joeraz commented 3 years ago

Also, kind of grasping at straws (still can't reproduce), but would either of you be able to test using the version of the code in this branch: https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize and let me know if that resolves the issue?

Maybe i find time at the weekend to install a recent Python Version.

Just want to say I have no problem to start Pysol with a 336 * 510 custom card set . Only changing the card set causes problems.

@cardset Don't know if it will help, but what Python version are you using? And are you running from source or the installer?

I did test with both 3.9 and 2.7, but maybe a version in between is the issue.

joeraz commented 3 years ago

To make it clear, I tried previous versions now. The problem is still there on 2.12.0, but 2.10.1 works fine. So it's some change after 2.10.1.

How is game actually debugged, are there any logs that are hidden in release version? I feel I could help, but now it's just blind guesses.

If it's happening with 2.12, that crosses out my previous theories. The changes I made to those windows were for 2.14 - the tree window and table tile were untouched (by me at least) for 2.12. It could be Python Version specific. I recall the Python Version in the installer was updated sometime between when 2.10 came out and when I joined the project.

Nebula-Mechanica commented 3 years ago

I will fork repo and experiment with reverts and builds to spot the right moment then. Will write here if I'll find something useful.

cardset commented 3 years ago

2.12

...

I only used the official .exe releases for testing.

... You wrote in another thread, the code is for Python 3.10 so I didn't even try the source.

....

I have Python 3 with Spyder 4. Updating sometimes causes problems. That's why I don't want to give a date. I try if i have time for it.

joeraz commented 3 years ago

@cardset Just to confirm, PySol should run with any version of Python from 2.7 through 3.10.

My previous comments about 3.10 were simply about making sure the code would work with Python 3.10, because PySolFC 2.12 crashed if you tried to run it with 3.10.

Sorry for any confusion.

cardset commented 3 years ago

Now i tried the code from https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize All problems still there.

shlomif commented 3 years ago

Hi!

On Tue, 05 Oct 2021 20:41:53 -0700 cardset @.***> wrote:

Now i tried the code from https://github.com/joeraz/PySolFC/tree/feature/int-div-on-treesize All problems still there.

Chiming in, I'd like to note that https://docs.python.org/3/library/trace.html or https://docs.python.org/3/library/pdb.html may help.

--

Shlomi Fish https://www.shlomifish.org/ https://www.shlomifish.org/humour/Summerschool-at-the-NSA/

Sesquipedallianism: making excessive use of long words.

Please reply to list if it's a mailing list post - https://shlom.in/reply .

cardset commented 3 years ago

Error is always: _tkinter.TclError: bad screen distance

Maybe somewhere a mismatch between tuple and single number

joeraz commented 2 years ago

Based on what I hear, I have a pretty good idea which change is responsible for the issue. I attempted to make that change using a different method (which I'd have probably needed to do anyway to simplify future modifications on those windows).

Can you check against the new commit in this branch, to see if this resolves the issue: https://github.com/shlomif/PySolFC/tree/feature/int-div-on-treesize

If you want an installer, you can get one from the AppVeyor artifacts: https://ci.appveyor.com/project/shlomif/pysolfc/builds/41082628/artifacts

Let me know if this helps.

cardset commented 2 years ago

Let me know if this helps.

does not solve the problem, whether the code nor the installer

joeraz commented 2 years ago

Darn. Back to square one.

I don't suppose anyone can get me a full stack trace?

cardset commented 2 years ago

Could you write some short example, of what you think causes the error?

Something like this

` from tkinter import *

root = Tk() root.geometry("200x300") root.title("main")

l = Label(root, text = "This is root window")

top = Toplevel() top.geometry("180x100") top.title("toplevel") l2 = Label(top, text = "This is toplevel window")

l.pack() l2.pack()

top.mainloop() `

joeraz commented 2 years ago

There is one more change you might want to try in latest master in case the issue is actually float vs. integer rather than tuple vs. integer - I'm skeptical this will work because the same logic is used in other places without issue, but I suppose it's worth a try.

The main fix that I believe to be the cause of this issue is my attempts to make these screens auto-scale to the user's monitor size, which I did to help higher resolution cardsets look better in playable preview, and because I was having issues with one of the windows being cut off when I tested on a smaller monitor. Here are the commits involved - this should point out some of the code that I believe to be the most likely cause:

cardset commented 2 years ago

5aa9071 At this point the Select Game bug occurs first time.

92e562b First Time with problems Options/ Cardset. Options/Table tile is okay.

0fb76d0 First Time Options/Table Tile crashes

Error always something like that, with different values but in the same format. _tkinter.TclError: bad screen distance "1140.0"

cardset commented 2 years ago

5aa9071

363 h = int(sh * .8)

does the job correctly

joeraz commented 2 years ago

Thought it might be something like that. Implemented in the test branch again: https://github.com/shlomif/PySolFC/tree/feature/int-div-on-treesize

This one work?

cardset commented 2 years ago

The code is still old. But copying the new things by hand helps.

The known bugs are gone.

By the way, i always have to change html-src to html and copy PySolFC/data/images to PySolFC/images to get the code work.

How can i avoid this?

joeraz commented 2 years ago

Tried copying the changes to latest master if you'd like to verify.

As for your questions - html and html-src are actually two different things. The html folder contains the actual html files used for the documentation, but these files are actually auto-generated based on the files in html-src - some data is pulled from pysollib directly. The gen-html.py file in html-src will generate a copy of the html folder - you may need to temporarily copy the pysollib folder into html-src to get this to run. The images folder is located based on the data folder that PySol tries to use, which is based on the location of the html/license.html file. If a copy of that html folder is placed in the data folder, the code will look for the images (and other data files) inside the data folder.

Nebula-Mechanica commented 2 years ago

I confirm that issue is fixed in new build from master. Thank you all!

Not sure if I should close the issue, since there was no official release, so I just leave it like this.

joeraz commented 2 years ago

I'll close it in a couple days if nothing else comes up. Prefer to close issues when they're fixed so I can better keep track of what's still to do.