xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 5 years ago

Closed 5 years ago

Last modified 17 months ago

#1606 closed defect (fixed)

Two 'referenced before assignment' bugs in main.py

Reported by: Ray Donnelly Owned by: Ray Donnelly
Priority: major Milestone: 2.2
Component: client Version: trunk
Keywords: Cc:


Thanks for working on the software, it's really useful.


2017-07-29 13:46:20,160 error preparing connection: local variable 'xdpi' referenced before assignment
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/client_base.py", line 317, in send_hello
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/gtk2/client.py", line 287, in make_hello
    capabilities = GTKXpraClient.make_hello(self)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/gtk_base/gtk_client_base.py", line 418, in make_hello
    capabilities = UIXpraClient.make_hello(self)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/ui_client_base.py", line 1424, in make_hello
    self._last_screen_settings = (root_w, root_h, sss, ndesktops, desktop_names, u_root_w, u_root_h, xdpi, ydpi)
UnboundLocalError: local variable 'xdpi' referenced before assignment


2017-07-29 13:48:03.573 Xpra[2551:63940] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
xpra main error:
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 176, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 1324, in run_mode
    return run_remote_server(error_cb, options, args, mode, defaults)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 2468, in run_remote_server
    app.start_new_session = sns
UnboundLocalError: local variable 'sns' referenced before assignment

Change History (7)

comment:1 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to Ray Donnelly

The first one (xdpi) is resolved here: #1605

For the second one, please include the exact command line that you've used so that I can make sure the fix is correct.

comment:2 Changed 5 years ago by Ray Donnelly

/Applications/Xpra.app/Contents/MacOS/Xpra start ssh/ME@IP_ADDRESS/100 --dpi=96 --swap-keys=no --start-child=gnome-terminal

comment:3 Changed 5 years ago by Antoine Martin

Thank you very much! Found lots of little problems.

The following fixes will be included in the next stable update:

  • a useful warning was being swallowed: r16554
  • remote start via ssh was broken (oops): r16555
  • attach wrongly defaulted to false on macos (triggering the problem just below): r16557
  • when attach is set to false, don't use the "start_new_session" structure and just wait for the connection to drop: r16556
  • when an option is not meaningful (ie: xvfb on macos), keep the value as it is so we don't forward it to the server during remote start: r16558

All these fixes are available in the latest 2.2 beta build for macos which you can find here: http://xpra.org/beta/osx. Please close if that works for you.

comment:4 Changed 5 years ago by Ray Donnelly

Wow, thanks for being so responsive! I will check it later.

My main goal here is to see what's up with the command button ending up with the same keycode on the remote (linux side) and the alt button.

state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

I *think* I need it to be Super_L instead. I know keyboard handling is a difficult topic; wish me luck. I read this bug report and it seems somewhat related: https://bugzilla.gnome.org/show_bug.cgi?id=736125 but if you have any better pointers I'd appreciated it (I know about -d keyboard).

Also, I found setting up the build env to be very difficult and gave up (I'm pretty experienced at this kind of thing, working on 2 software distros). In the end, I'm using your releases but copying the .py files beside the .pyc ones so I can test my changes! I wonder if doing this for official releases might lower the barrier to entry a little?

Thanks again. I'll give more feedback later.

Last edited 5 years ago by Antoine Martin (previous) (diff)

comment:5 Changed 5 years ago by Antoine Martin

Please use a different ticket for keyboard issues.
(sound like we may want to manually backport this patch to GTK2 for macos)

comment:6 Changed 5 years ago by Ray Donnelly

Resolution: fixed
Status: newclosed

This is now fixed, many thanks.

comment:7 Changed 17 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1606

Note: See TracTickets for help on using tickets.