Page 1 of 1

[RESOLVED] Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 6:34 pm
by eleazar
I haven't been able to get the last couple mac binaries to work.

SVN 6654 loads up and runs, but there is absolutely nothing in the universe-- no stars, planets, or empires.

Code: Select all

2014-01-31 12:24:54,318 ERROR Server : Unable to import universe generator script
2014-01-31 12:24:54,318 ERROR Server : Traceback (most recent call last):
2014-01-31 12:24:54,318 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/UniverseGenerator.py", line 2, in <module>
2014-01-31 12:24:54,318 ERROR Server :     import random
2014-01-31 12:24:54,318 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/random.py", line 47, in <module>
2014-01-31 12:24:54,318 ERROR Server :     from os import urandom as _urandom
2014-01-31 12:24:54,318 ERROR Server : ImportError: cannot import name urandom
Attached are the logs.

The very latest version fails differently-- something about not being able to contact the server. That's probably the more relevant issue, and i'm re-downloading the latest binary so i can try and describe that one too.

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 6:39 pm
by eleazar
SVN 6756

This binary downloaded much more quickly than last time.

After selecting settings, and working for a while i get a black screen and:
"The connection to the server has been lost."

Code: Select all

2014-01-31 12:35:38,849 ERROR Server : Unable to import universe generator script
2014-01-31 12:35:38,849 ERROR Server : Traceback (most recent call last):
2014-01-31 12:35:38,849 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/UniverseGenerator.py", line 2, in <module>
2014-01-31 12:35:38,849 ERROR Server :     import random
2014-01-31 12:35:38,849 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/random.py", line 47, in <module>
2014-01-31 12:35:38,849 ERROR Server :     from os import urandom as _urandom
2014-01-31 12:35:38,849 ERROR Server : ImportError: cannot import name urandom

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 7:08 pm
by Geoff the Medio
It often helps to google the error message. I don't know if that makes any sense, but can you try something similar?

It might be trying to load your system Python install which is possibly a different version from what comes in the app bundle...?

This sounds similar to issues Vezzra has been dealing with, as discussed here: https://sourceforge.net/p/freeorion/bugs/553/
and here: viewtopic.php?p=67382#p67382

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 7:36 pm
by Vezzra
Geoff the Medio wrote:It might be trying to load your system Python install which is possibly a different version from what comes in the app bundle...?

This sounds similar to issues Vezzra has been dealing with, as discussed here: https://sourceforge.net/p/freeorion/bugs/553/
and here: viewtopic.php?p=67382#p67382
Yep, that's exactly what's happening here, and exactly the same error message I found in the server log provided with this bug report. I've already committed a fix to ensure the Python framework bundled with the FO app gets used, hopefully that takes care of this problem.

@eleazar: The upcoming Moday test build will already include the fix, please report back if that build works on your system.

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 7:41 pm
by Geoff the Medio
Vezzra wrote:@eleazar: The upcoming Moday test build will already include the fix, please report back if that build works on your system.
Any chance you can make an OSX build today? Kind of an important issue, and a waste of a weekend's potential work...

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 8:02 pm
by eleazar
Geoff the Medio wrote:Kind of an important issue, and a waste of a weekend's potential work...
As far as i'm concerned, it won't make much difference.

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 8:04 pm
by Vezzra
Geoff the Medio wrote:Any chance you can make an OSX build today? Kind of an important issue, and a waste of a weekend's potential work...
Done.

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 8:12 pm
by Vezzra
eleazar wrote:
Geoff the Medio wrote:Kind of an important issue, and a waste of a weekend's potential work...
As far as i'm concerned, it won't make much difference.
Too late :mrgreen:

Re: Mac seems to choke on python universe generation.

Posted: Fri Jan 31, 2014 8:20 pm
by eleazar
Fix confirmed. :)

Re: [RESOLVED] Mac seems to choke on python universe generat

Posted: Sat Feb 01, 2014 8:10 am
by adrian_broher
Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.

Re: [RESOLVED] Mac seems to choke on python universe generat

Posted: Sat Feb 01, 2014 8:13 am
by Geoff the Medio
adrian_broher wrote:Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.
https://sourceforge.net/p/freeorion/code/6774/

(Not a project file change...)

Re: [RESOLVED] Mac seems to choke on python universe generat

Posted: Sat Feb 01, 2014 8:17 am
by adrian_broher
Geoff the Medio wrote:(Not a project file change...)
Okay, I expected one, but seems like he didn't came around yet.

Re: [RESOLVED] Mac seems to choke on python universe generat

Posted: Sun Feb 02, 2014 3:15 pm
by Vezzra
adrian_broher wrote:Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.
adrian_broher wrote:
Geoff the Medio wrote:(Not a project file change...)
Okay, I expected one, but seems like he didn't came around yet.
The fix I committed (rev 6774) was the "quick and dirty" one, which I referred to in the thread you linked and want to replace with a more elegant solution. But as you mentioned there, that will require some fiddling, and I've already more on my plate than I can handle ATM, so I decided I'll get around to that later. The "quick and dirty" fix works, it has for years actually (as it had to be done for the AI clients also), so there's no pressure to implement the better fix immediately.