FunKiiU
FunKiiU copied to clipboard
Unknown character stops all downloads
For example, 000500001011a400 is "Super Street Fighter Ⅱ" where that Ⅱ can't be interpreted and crashes the program.
This is especially an issue with -region
At the very least, adding an -ignore TITLE1 TITLE2 ... would allow people to manually circumvent the issue.
When does it crash? During folder creation time? A stack trace might be helpful as well to see which line of code if causing the issue. I dont understand why it wouldn't just be interpreted as two capital 'i' (II). There are still some unicode issues I believe so it might be related. If it works fine in python 3 and not python 2 then that's probably the case. Is it broken on both versions?
I'm gonna run a few tests and see if its just the print statement breaking it. I'm wondering if since print() wraps stdout maybe it has something to do with the users terminal encoding and not python itself.
Ⅱ isn't two "I"s, it's 1 character. I'm not a python dev, but it may be that it's just an obscure Unicode character and the terminal having an issue with it (Trying to paste the char into my terminal resulted in a "?").
https://en.wiktionary.org/wiki/Ⅱ
Ya I'm not an expert in unicode but its definitely an obscure unicode character. I'm also having issues populating a combobox in tk with the same titles.
This issue definitely has something to do with printing to the users terminal and it's encoding. The print statement on line 116 is what breaks and the exact same output prints just fine in IDLE's terminal.
It also prints fine in linux. It also does not happen when entering key manually using -key argument. I'm gonna try a couple things.
It also does not happen when entering key manually using -key argument
Yeah, but that doesn't really help when using the -region arg.
Modifying line 116 by removing the title fixes the issue.
I think the best solution right now would be a try: except UnicodeEncodeError: block where it tries to print normally and if above exception is raised then wrap outfname with repr() So far this is the best solution ive worked out since we dont know if a users terminal supports the character or not. printing repr(outfname) will stop it from breaking while still printing the title name, if it has unprintable char in it.
I will submit a pull request today
It seems that if this is the right solution, it should be applied to the log function. I thought this error could be more consistently handled by changing this print to a log, since log's ostensible purpose is to handle this output encoding.