FreeOrion

Forums for the FreeOrion project
It is currently Sun Oct 22, 2017 10:33 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sat Sep 24, 2016 10:32 am 
Offline
Space Krill

Joined: Sat Sep 24, 2016 10:17 am
Posts: 3
Hello everybody,

when I try to start a new single player match it crashes with the error message "ERROR: Python AI for AI_1 crashed." What am I doing wrong or can adjust?

FO-Version: FreeOrion_v0.4.6_2016-09-16.49f9123_Win32_Setup
OS: Win 10

Thank you in advance

PS. sorry for my bad english!


Top
 Profile  
 
PostPosted: Sun Sep 25, 2016 1:59 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4226
Location: Sol III
As an important first source of information we need the log files FO created on your system. See here for instructions where the log files can be found on your system.

To be safe provide all the log files you find in there, freeorion.log, freeoriond.log and all the AI_XX.log files.


Top
 Profile  
 
PostPosted: Sun Sep 25, 2016 2:12 pm 
Offline
Space Krill

Joined: Sat Sep 24, 2016 10:17 am
Posts: 3
During this game I had only one AI. So there is only one respective log-file. But the error occurres also with multiple AI-players.


Attachments:
freeoriond.log [3.68 KiB]
Downloaded 26 times
AI_1.log [3.71 KiB]
Downloaded 28 times
freeorion.log [8.77 KiB]
Downloaded 24 times
Top
 Profile  
 
PostPosted: Sun Sep 25, 2016 2:52 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4226
Location: Sol III
Hm, the issue is quite obvious, according to this line in the AI error log:
Code:
19:15:50.633145 [error] AI : AI Config: default file is not present and not writable at location C:\Users\Benjamin Schäfer\AppData\Roaming\FreeOrion\AI\default\config.ini
2016-09-24
...the AI process fails to create a required config file in your AppData directory tree. My first guess is that the special character "ä" in your user name might cause the issue - although I thought we caught all the locations where special characters in file paths caused problems.

Can you try and create an additional user on your system, with a username without any special characters, and try to launch a game under this new account?

If that doesn't fix it, there must be something amiss with the access permissions in you user profile directory. That folder should be writeable...


Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 7:53 am 
Offline
Space Krill

Joined: Sat Sep 24, 2016 10:17 am
Posts: 3
Thank you very much!

Creating a new user without the character "ä" works. There was no error anymore.


Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 11:25 am 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Vezzra wrote:
Code:
19:15:50.633145 [error] AI : AI Config: default file is not present and not writable at location C:\Users\Benjamin Schäfer\AppData\Roaming\FreeOrion\AI\default\config.ini
2016-09-24


If you take a look into the stack trace you will see:

Code:
C:\\Users\\Benjamin Sch\xc3\xa4fer\\AppData\\Roaming\\FreeOrion\\config.ini


That means the string data IS utf-8 encoded (\xc1\xa4 is the byte sequence of an utf-8 encoded ä) but is not recognized as a python unicode string but handed over as, well, Python terminology calls it string but it's just a byte sequence with no determined encoding. Problem here is that windows uses utf-16le as file path encoding where the ä is represented by \x00\xe4 so there is no match between those pathes when comparing them as dumb byte sequences. This problem doesn't occur on Mac or Linux because the file pathes are dumb byte sequences that happen to be encoded as utf-8.

The python open function determines if the path should be handed over to the operating system as dumb byte sequence or converted to the native filesystem encoding by passing either a python unicode string or a regular python string as path. We do the latter and should do the former. So adding something like

Code:
f = open(unicode(path, 'utf-8'), 'r') // convert path to a unicode object and


should do the trick for now.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 12:21 pm 
Offline
Dyson Forest
User avatar

Joined: Fri Jul 29, 2016 10:12 am
Posts: 201
http://xkcd.com/1726/


Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 1:19 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
EricF wrote:
http://xkcd.com/1726/

xkcd, one of the most unfunny net content I ever came across.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 2:23 pm 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Should be fixed with 737d4a3c.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group