markweirath / big-brother-bot

Big Brother Bot B3 is a complete and total server administration package for online games. B3 is designed primarily to keep your server free from the derelicts of online gaming, but offers more, much more.
http://www.bigbrotherbot.net
44 stars 32 forks source link

python 2.5- / 3.x - B3 does not work and shows no relevant error message #75

Closed thomasleveil closed 12 years ago

thomasleveil commented 12 years ago

B3 is not compatible with python 3.x and not compatible with python 2.5-

what's expected

B3 should detect that it starts from a python 3.x or <2.6 interpreter and show a user friendly error message and stop.

what's really happening

See forum topic and error 2.5

uts-clan:/home/b3# python ./b3_run.py -r -c /home/b3/b3/conf/b3.xml
Running in auto-restart mode...
checking for updates...
latest B3 version is 1.7.1
...no update available.
Starting www.bigbrotherbot.net (b3) v1.8.0b [posix] [Seda]

Using config file: /home/b3/b3/conf/b3.xml
CRITICAL: Cannot find parser 'cod4'. Check you main config file (b3.xml)
B3 failed to start.
ImportError('No module named thread',)
Exited with status 1
Error, stopping, check console.
uts-clan:/home/b3#
markweirath commented 12 years ago

I wasn't able to test the fix. It'll need confirmation before closing the issue.

82ndab-Bravo17 commented 12 years ago

Doesn't work on Windows, please see comments to 7ede28b above for a fix

thomasleveil commented 12 years ago

python 3 needs to be detected even before the b3.run module is imported. see 7c63675 that does prevent B3 from starting when used with python 3.

For windows users, the drawback is that the cmd windows won't ask "press any key to continue" and they might just think B3 crashes. Anyway this is still better than having to crawl through a log and stacktrace to guess what happened.

thomasleveil commented 12 years ago

Does anyone has python 2.5 and can run a test with it ?

82ndab-Bravo17 commented 12 years ago

My 2.5 dll seems to have gone missing, but I changed the test to fail on 2.6 and it did, but allowed 2.7 to run. I'll see if I still have the install file for 2.5 later.

82ndab-Bravo17 commented 12 years ago

I get:

G:\b3-180b\BF3-b3-1>G:\Python25\python.exe G:\B3-180b\b3_run.py -c G:\b3-180b\BF 3-b3-1\bf3b3-1.xml Traceback (most recent call last): File "G:\B3-180b\b3_run.py", line 40, in import b3.run File "G:\B3-180b\b3init.py", line 37, in import pkg_handler File "G:\B3-180b\b3\pkg_handler.py", line 33, in from b3.functions import main_is_frozen File "G:\B3-180b\b3\functions.py", line 39, in import json ImportError: No module named json

with 2.5!!!!!

import sys if sys.version_info >= (3,): raise SystemExit("Sorry, cannot continue, B3 is not yet compatible with python version 3!") if sys.version_info < (2,6): raise SystemExit("Sorry, cannot continue, B3 is not compatible with python versions earlier than 2.6!")

in b3_run seems to work

thomasleveil commented 12 years ago

you mean the SystemExit exception does not stop the process ?

82ndab-Bravo17 commented 12 years ago

No, I think that it is failing in import b3.run again, just like 3.2.2 did since json doesn't seem to be included in 2.5?

b1naryth1ef commented 12 years ago

If I remember correctly you can use SimpleJSON for pre-2.6.

thomasleveil commented 12 years ago

exact, but that would be a pity to write a bit of 2.5 compatible code just to tell the user the soft cannot be run with 2.5 :s

b1naryth1ef commented 12 years ago

I believe you can just replace the import. So import simplejson as json or something along those lines.