Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gogdl fails on dowloading game with non ASCII characters #6

Closed
Qowy opened this issue May 13, 2022 · 12 comments
Closed

gogdl fails on dowloading game with non ASCII characters #6

Qowy opened this issue May 13, 2022 · 12 comments

Comments

@Qowy
Copy link

Qowy commented May 13, 2022

fixes Heroic-Games-Launcher/HeroicGamesLauncher#1298

gogdl/dl/linux_native.py", line 120
subprocess.run(command, shell=True) maybe subprocess.run(command, shell=True, encoding="utf-8") will workt, but probably more than just this location

@imLinguin
Copy link
Member

I don't have any way to test that really. I will push suggested change to testing branch later, so you can test it with built binary

@imLinguin
Copy link
Member

Binary will be available after all builds finish: https://github.com/Heroic-Games-Launcher/heroic-gogdl/actions/runs/2319880923

@Qowy
Copy link
Author

Qowy commented May 13, 2022

Thank you, where would I put this into my heroic flatpak install for testing? (relative path is fine)

@imLinguin
Copy link
Member

imLinguin commented May 13, 2022

You can select alternative gogdl binary in Heroic settings. Make sure to mark downloaded binary as executable

@Qowy
Copy link
Author

Qowy commented May 13, 2022

Ok Thank you very much, download works now.

However now we have the same problem during Install

A second test binary would be greatly appreciated

[PROGRESS] INFO: = Progress: 99.70 2349387629/2356457175, Running for: 00:00:00, ETA: 00:02:56
[PROGRESS] INFO: = Downloaded: 2240.55 MiB
[LINUX] INFO: Checking available disk space
warning [/home/deck/.var/app/com.heroicgameslauncher.hgl/cache/heroicGOGdl/tr_berbrook_1_6_31066.s]:  959462 extra bytes at beginning or within zipfile
  (attempting to process anyway)
[LINUX] INFO: Looks fine continuing
[LINUX] INFO: Unpacking game files
[LINUX] INFO: Unpacking installer using unzip
warning [/home/deck/.var/app/com.heroicgameslauncher.hgl/cache/heroicGOGdl/tr_berbrook_1_6_31066.s]:  959462 extra bytes at beginning or within zipfile
  (attempting to process anyway)
[LINUX] INFO: Moving game files
Traceback (most recent call last):
  File "gogdl/cli.py", line 44, in <module>
  File "gogdl/cli.py", line 40, in main
  File "gogdl/dl/manager.py", line 30, in download
  File "gogdl/dl/manager.py", line 98, in get_download_metadata
  File "gogdl/dl/linux_native.py", line 62, in download
  File "gogdl/dl/linux_native.py", line 140, in download_installer
  File "subprocess.py", line 505, in run
  File "subprocess.py", line 951, in __init__
  File "subprocess.py", line 1754, in _execute_child
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 125: ordinal not in range(128)
[222] Failed to execute script 'cli' due to unhandled exception!

@imLinguin
Copy link
Member

I'm afraid it's the same line, number is different since I formated the code a bit. I'll try different approach tomorrow

@Qowy
Copy link
Author

Qowy commented May 13, 2022

I just noticed that, too strange. but now it at least started to download, wonder what changed there.

Maybe I will also try and debug this myself, any caveats bulding this binary?

@Qowy
Copy link
Author

Qowy commented May 13, 2022

Ok I downloaded the code and compiled it myself:

subprocess.run(command.encode("utf-8"), shell=True)

This works for me. May need some regression testing (especially on windows maybe?)
But I guess normal Games with ASCII only names should not get any worse from this.
Additionally validating the manifest and normalizing the path to only use ascii characters might be a nicer solution, but this probably breaks down once you would have something like a game with Japanese Characters etc. (Since there is no trivial ascii equivalent)

Anyway with this it installed sucessfully on linux

@Qowy
Copy link
Author

Qowy commented May 14, 2022

The same problem popped up here: redromnon/HeroicBashLauncher#57
Maybe the solution proposed there will also work and is generally more compatible?
Someone with more python knowledge than me should probably decide that ;)

@imLinguin
Copy link
Member

imLinguin commented May 14, 2022

New commit on testing https://github.com/Heroic-Games-Launcher/heroic-gogdl/actions/runs/2323991359
Hopefully this will work, strangely I wasn't able to reproduce the issue on my machine for path with ü

@Qowy
Copy link
Author

Qowy commented May 22, 2022

Seems to work fine, will you push this to the main branch?

@imLinguin
Copy link
Member

fixed and merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants