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

Installer breaks if username is not in English / With non-english locale? #111

Open
why8447 opened this issue Jul 13, 2020 · 5 comments
Open
Labels
fix_applied describes if a fix has been applied, but not confirmed as working/hasn't been reviewed

Comments

@why8447
Copy link

why8447 commented Jul 13, 2020

First of all, I am sorry through the translator because I am Korean.
The current problem is that there is an error during installation through the mode installer.
TypeError: '>=' not supported between instances of 'UnicodeDecodeError' and 'int'
It's an error statement written on the terminal.

  • My operating system is [Windows]
  • I installed the game [2 weeks ago]
  • I am trying the [Full Patch]
  • I installed the game [using the Automatic Installer (steam)]
  • My computer is a [Gaming desktop]

Sorry for asking Github, not discode, because I am not good at English.
I ran it in Safe Mode, but the error came out the same.
I really want to do it, but I don't know what to do. Please help me.

@andOlga
Copy link
Member

andOlga commented Jul 13, 2020

Please paste the full installer log as it's not really clear where the error is just from the description of it.

@andOlga andOlga transferred this issue from 07th-mod/umineko-question Jul 13, 2020
@drojf
Copy link
Collaborator

drojf commented Jul 13, 2020

You can find the installer log file like this. There may be more than one log file.

Untitled

@drojf drojf changed the title UnicodeDecodeError Installer breaks if username is not in English / With non-english locale? Jul 15, 2020
@drojf
Copy link
Collaborator

drojf commented Jul 15, 2020

The user resolved the issue (they changed their locale and/or moved the installer it to a folder which was valid UTF-8)

But we should evaluate whether it's feasible to fix it OR add an item to the FAQ / startup-check to tell the user to run the installer from a different folder/change their locale.

@drojf
Copy link
Collaborator

drojf commented Jul 15, 2020

O[A] told me where the problem is - https://github.com/07th-mod/python-patcher/blob/master/common.py#L283 causes an issue:

  1. this part can cause invalid characters read back from aria2c/7z stdout (or maybe just the weird logger thing I created)
  2. when the invalid characters are interpreted back as UTF-8 (so that the installer can check aria2c's download status etc), the unicode conversion fails
  3. where there would be a string, a UnicodeDecodeError is instead passed along, until something that actually requires it causes an error

We could just "avoid" the error by ignoring invalid unicode feedback from aria2c/7z, but doing so would break the "subtask progress" bar (although you could probably still see the output on the console). Still, seems better than not being able to use the installer at all

Tests:

  • Set non-english computer name
  • Set non-english username
  • Set non-english locale
  • Launch or install to folder with invalid unicode in path?

@drojf
Copy link
Collaborator

drojf commented Sep 23, 2020

So, someone else had this error, and didn't have any non-english locale on their system. After looking into it, it appears that it was just a bug in my code, where in the exception handler I called the traceback_exc function with the wrong arguments, causing another exception, which then caused the installer to fail. You can see it in 768c9f9

Earlier I said "We could just "avoid" the error by ignoring invalid unicode feedback from aria2c/7z, but doing so would break the "subtask progress" bar (although you could probably still see the output on the console).", but that is exactly what the installer was already supposed to do, just that it was broken because of the above bug.

As to why you can get invalid unicode, well my output parser is pretty dumb, and reads data from 7zip/aria2c by grabbing whatever bytes are available at the time, then printing them once reaching a special terminator. I would imagine that it might accidentally try to print in the middle of a Unicode sequence, leading to a unicodeEncodeDecode error, but I'm not really sure if that is what causes it.

I'll leave this issue up in case we have more unicode related errors in the future.

Edit: this didn't actually fix the user's issue. Their windows language was set to "Turkish", and it only failed when extracting the BGM file, not other files.

Edit2: We're probably running into this issue: https://stackoverflow.com/questions/33283603/python-popen-communicate-str-encodeencoding-utf-8-errors-ignore-cr

@drojf drojf added the fix_applied describes if a fix has been applied, but not confirmed as working/hasn't been reviewed label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix_applied describes if a fix has been applied, but not confirmed as working/hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

3 participants