CrossOver Support - Community Forums

Important Information These are community forums and not official technical support. If you need official support: Contact Us

CrossOver Linux
Discussion about CrossOver Linux

The following comments are owned by whoever posted them. We are not responsible for them in any way.

Back to Threads Reply to Thread

Issues with setarch command

I've been messaging Sil about this issue, and while waiting for a response I figured I'd pose a question to the community. I'm getting these errors when I try to run the setarch command for the Battle.net launcher.

Arch% setarch i386 -3 -L -B -R "/opt/cxoffice/bin/cxrun" --bottle "Diablo_III" "home/d6/.cxoffice/Diablo_III/drive_c/Program Files/Battle.net/Battle.net Launcher.exe"    
Traceback (most recent call last):
  File "/opt/cxoffice/bin/cxrun", line 87, in <module>
    import bottlequery
  File "/opt/cxoffice/lib/python/bottlequery.py", line 10, in <module>
    import cxproduct
  File "/opt/cxoffice/lib/python/cxproduct.py", line 62
    except OSError, ose:
                  ^
SyntaxError: invalid syntax

Does anyone see any syntax errors that I'm missing, or has anyone else ran into these errors?

You mean the Python syntax error on line 62 of the file at /opt/cxoffice/lib/python/cxproduct.py?

I'm way behind on my plans to master python, since I had to lear HTML in a sudden rush. But in this case, I would dare to state that the syntax error, if true, is in Codeweavers court. It would seem superficially that the python interpreter is not expecting the "," caracter after OSError. I would report this directly to the staff, perhaps with a support ticket. If there truly is a problem, they would sure be glad to correct it.

Looking at it though, you wouldn't trigger this problem unless there is some trouble getting your home directory, since it is in a function defined as def get_user_dir(): which then contains try, except, if, and else statements. If your home was divulged at the "try" statement, you wouldn't trigger the "except OSError, ose:" error.

Of course, being no python guru, I might be blind, dumb and stupid about what actually is going on. 😋

Donny Roe wrote:

I've been messaging Sil about this issue, and while waiting for a
response I figured I'd pose a question to the community. I'm getting
these errors when I try to run the setarch command for the
Battle.net launcher.

Does anyone see any syntax errors that I'm missing, or has anyone
else ran into these errors?

What does 'python --version' give you? How about 'which python2' ?

Python 3.4.1

/usr/bin/python2

What do you mean something could be wrong with my Home directory. I'm not following what you mean.

Donny Roe wrote:

Python 3.4.1

/usr/bin/python2

What do you mean something could be wrong with my Home directory.
I'm not following what you mean.

I think the problem is actually that you are using python 3 instead of python 2.x to run CrossOver's utilities. CrossOver's python code is not compatible with Python 3: the syntax giving rise to the error you see above is legal python 2.x but illegal python 3 (I'm pretty sure, anyway ... I have a memory of seeing that once in the past, although I'm not enough of a python expert to have the differences memorized).

In some places we attempt to mitigate the fact that lots of our code isn't python3 compatible by detecting python 3 and, if present, attempting to find and use python 2 instead. However, it's not a complete solution and we don't do it everywhere.

You can try moving python to something like python3, and moving python2 to python ... you might be able to do that temporarily, and I think that would do it. (Note: messing around with which python is the default can muck up other things on your system, so you may want to just try it temporarily to make sure CrossOver will work.)

Eventually we will have to become python 3 compatible. It's not clear when that will happen. However, it may be that we can employ the strategy of detecting python 3 and switching to python 2 in the case that's biting you, in which case we should. I'm not certain yet that it is possible, but it may be.

Ah, I see what you mean. I'd love to give that a try but I don't even know where to begin to do so. I'll do some more research tomorrow and see what I can come up with. It's gonna drive me crazy till I can get it figured out. Haha

The worst part is, I don't need to use the command. It would just make the battle.net app more stable. Luckily in this case everything works, but like I said, it's gonna drive me insane until it does haha.

Edit: Also J-P since you're running Arch too, would you mind giving it a go and see if the command gives you the same error? I'm on stable in Arch so I'd assume you're at the same version with Python. It might help narrow it down a bit.

It does not make the battle.net app more stable, it makes Diablo III stable and playable. So you do need to run it like that, else you will see all kinds of weird behavior like unresponsive UI elements in game, getting stuck at retrieving hero information, crap performance because apparently warden poops its pants when run in a normal 4GB address space...

These bugs are still relevant and remain to be fixed:

https://bugs.winehq.org/show_bug.cgi?id=30849
https://bugs.winehq.org/show_bug.cgi?id=33413

Donny, you can have python 2 and 3 on your system at the same time. The "python" package is python 3, and the "python2" package, well, you know... So judging from the thread, a little "pacman -S python2" is in order.

The command:
python2 --version
"Should spit out Python 2.7.8"

Just so you know, the Crossover PKGBUILD in the AUR is wrong about its depedencies. It list "python" as a depedency when it should be "python2" for some time now. I have put a comment on the thread to have this corrected by the maintainer.

Having Python 2 on your system, it would make your command something like:

setarch i386 -3 -L -B -R python2 "/opt/cxoffice/bin/cxrun" --bottle "Diablo_III" "home/d6/.cxoffice/Diablo_III/drive_c/Program Files/Battle.net/Battle.net Launcher.exe"

That should at least get you past the syntax error.

Donny Roe wrote:

Ah, I see what you mean. I'd love to give that a try but I don't
even know where to begin to do so. I'll do some more research
tomorrow and see what I can come up with. It's gonna drive me crazy
till I can get it figured out. Haha

If the moving python 3 out of the way part is the part you wouldn't know where to begin with, that would go something like this:

cp /usr/bin/python /usr/bin/python3
rm /usr/bin/python
ln -s /usr/bin/python2 /usr/bin/python

... and then re-run the CrossOver utilities you want to use. You'll need to do the above with permissions to change files in /usr/bin, meaning you'll probably have to be root. (The first line is a copy so you can un-do the change later if you want to and make 'python' be python version 3 again.)

As JP says, you can have both versions of python installed at once. I'm not really sure how most of our Arch users solve the problem.

In any case, I did enter a bug about trying to detect and switch between python versions in more places in our code: maybe there are things we can do to make it better. Ideally it would just work.

I just have both python 2 and 3. Rarely do I have to specify python 2 to execute anything for Crossover. What Donny was trying obviously did require a specific command, but it usually isn't necessary. I don't remember the last time Crossover gave me python based trouble.

EDIT: And I would recommand trying to remove python 3 through pacman before rm'ing anything. I can only imagine what crap could result in deleting files from a package without the package manager knowing about it.

J-P Simard wrote:

I just have both python 2 and 3. Rarely do I have to specify python
2 to execute anything for Crossover. What Donny was trying obviously
did require a specific command, but it usually isn't necessary. I
don't remember the last time Crossover gave me python based trouble.

That's good to know.

J-P I'll give it a shot real quick.

Sil: I know I'm sounding condescending when I say I don't need the command. I'm not trying to be. I understand the relevancy of the command. But in my current situation the freezing and issues with the UI have ceased. I will always respect your advice and that of the other people here. You all have probably forgotten more than I know. Just to get things clear.

Edit: After running J-P's command, I got passed the errors in the terminal. But now I'm getting a Wine error that says "There is no Windows program configured to open this type of file."

It just happens to coincide with the launch of the new patch. Warden is usually deactivated on launch and activated after a while.

Don't know how the current command line looks, but make sure you don't have some extra spaces in there. Anyway, here's how it looks on my end with the extra python2 added:

http://pastebin.com/C4HHz5fj

*grumble*grumble putting the same code between [code][/code] tags adds an extra space at the end of the line, which, ofc, breaks things. Time to file a bug report :/

Sil, your script works perfectly. :D

Silviu Cojocaru wrote:

*grumble*grumble putting the same code between "code" tags adds an
extra space at the end of the line, which, ofc, breaks things. Time
to file a bug report :/

#!/bin/bash

bottle="Diablo_III"
crossover_install_dir="/opt"

setarch i386 -3 -L -B -R python2 "$crossover_install_dir/cxoffice/bin/cxrun" \
        --bottle "$bottle" \
        "$HOME/.cxoffice/$bottle/drive_c/Program Files/Battle.net/Battle.net Launcher.exe"

It does? Sorry, just putting this here so I can test and file a bug...

Caron Wills wrote:

Silviu Cojocaru wrote:

*grumble*grumble putting the same code between
"code" tags adds an extra space at the end of the line, which,
ofc,
breaks things. Time to file a bug report :/


#!/bin/bash

bottle="Diablo_III"
crossover_install_dir="/opt"

setarch i386 -3 -L -B -R python2 "$crossover_install_dir/cxoffice/bin/cxrun" \
--bottle "$bottle" \
"$HOME/.cxoffice/$bottle/drive_c/Program Files/Battle.net/Battle.net Launcher.exe"



> It does? Sorry, just putting this here so I can test and file a
> bug...

We fixed this issue on our website yesterday, thanks for pointing it out!

1 to 16 of 16

Please Note: This Forum is for non-application specific questions relating to installation/configuration of CrossOver. All application-specific posts to this Forum will be moved to their appropriate Compatibility Center Forum.

CrossOver Forums: the place to discuss running Windows applications on Mac and Linux

CodeWeavers or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in our Privacy Policy. You accept the use of cookies or other identifiers by clicking the Acknowledge button.
Please Wait...
eyJjb3VudHJ5IjoiVVMiLCJsYW5nIjoiZW4iLCJjYXJ0IjowLCJ0enMiOi02LCJjZG4iOiJodHRwczpcL1wvbWVkaWEuY29kZXdlYXZlcnMuY29tXC9wdWJcL2Nyb3Nzb3Zlclwvd2Vic2l0ZSIsImNkbnRzIjoxNzM0NzIyMzMzLCJjc3JmX3Rva2VuIjoiSHFkTFliQk1YMkhGblhhdCIsImdkcHIiOjB9