-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Python Error: UnicodeEncodeError - Can't launch game as of 4/14 #210
Comments
I think this is Minecraft itself crashing but the returned log could have some weird encoding making python think its
Could you go into your |
I wonder why this error happens on the "print" call tbh, is it possible to change the encoding of stdout? I've never seen this problem... |
I believe this might be due to a mismatch in the data returned on stdout and the inferred system encoding of |
Interesting, on Windows I get "cp1252", on Linux I get "UTF-8". This might be our issue, also it looks like that it's possible to do Source: https://docs.python.org/3/library/io.html#io.TextIOWrapper.reconfigure |
Interesting, I haven't changed anything on my end at all, and it worked yesterday, so i figured it must have been something to do with a cached file having strange characters (as in it downloads this file at every launch, for instance a version index or something like that). I did check my minecraft log, it did launch it for a second, this is all it had: [20:27:17] [main/INFO]: ModLauncher running: args [--username, Redacted, --version, forge-1.19.2-43.3.5, --gameDir, C:\redacted, --assetsDir, C:\redacted\assets, --assetIndex, 1.19, --uuid, redacted, --accessToken, redacted, --clientId, , --xuid, , --userType, , --versionType, release, --launchTarget, forgeclient, --fml.forgeVersion, 43.3.5, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] I have even attempted to remove all mods, it does not change the error. Also just to note: I am on PMC Version: 4.2.1 and Python Version: 3.8.10 |
Another thing to give you guys... Exception in thread Minecraft Stream Thread: Hope this helps Also in my previous experiences with PMC it never did log the console out before, however I do have PMC auto updating after every reboot. |
I have figured out what breaks it... it is when you try and output to a file. Adding >>test.log causes the error, but works without outputting to log. The strange part is that it has been working, but only recently broke today. |
When I do launch it from a console like normal, i did notice if you do not state an accesstoken it shows up as --accessToken, ❄❄❄❄❄❄❄❄ .... it looks like ?????? with boxes, but i guess it is snowflakes. lol. |
Yes these snowflakes are shown by forge to avoid displaying the token in clear. |
Thank you for this clear feedback! I can reproduce it! |
Looks like |
I have made no changes to anything, and was playing last night, however today when I launched, javaw.exe just hung after launching, checking logs I found this: I have tested with a new minecraft install, but this appears to be a python error.
[ .. ] Loading version forge-1.19.2-43.3.5...
[ OK ] Loaded version forge-1.19.2-43.3.5
[ .. ] Loading version 1.19.2...
[ OK ] Loaded version 1.19.2
[ .. ] Loading java...
[ OK ] Loaded Mojang java 17.0.8
[ OK ] Checked version jar
[ .. ] Checking assets version 1.19...
[ OK ] Checked 3390 assets version 1.19
[ .. ] Checking libraries...
[ OK ] Checked 91 class and 0 native libraries
[ OK ] Using logger client-1.12Exception in thread Minecraft Stream Thread:
Traceback (most recent call last):
File "c:\users\redacted\appdata\local\programs\python\python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "c:\users\redacted\appdata\local\programs\python\python38\lib\threading.py", line 870, in run
self._target(*self._args, **self.kwargs)
File "c:\users\redacted\appdata\local\programs\python\python38\lib\site-packages\portablemc\standard.py", line 1634, in process_stream_thread
if not parser.feed(line, self.process_stream_event):
File "c:\users\redacted\appdata\local\programs\python\python38\lib\site-packages\portablemc\standard.py", line 1677, in feed
callback(self.next_event)
File "c:\users\redacted\appdata\local\programs\python\python38\lib\site-packages\portablemc\cli_init.py", line 887, in process_stream_event
out.print(f"[{time}] [{event.thread}] [{event.level}] {event.message}\n")
File "c:\users\redacted\appdata\local\programs\python\python38\lib\site-packages\portablemc\cli\output.py", line 181, in print
print(text, end="")
File "c:\users\redacted\appdata\local\programs\python\python38\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 292-299: character maps to
When researching the bottom line, somebody said to fix it, you need to make sure you define your encoding table, like utf-8
The text was updated successfully, but these errors were encountered: