Opened 11 years ago

Closed 10 years ago

Last modified 7 years ago

#1755 closed defect (fixed)

sugar-emulator: better error message if X server is unreachable

Reported by: sascha_silbe Owned by: sascha_silbe
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Trivial Keywords: r+
Cc: tomeu Distribution/OS: Unspecified
Bug Status: Assigned

Description

Seems I didn't test the error case of not being able to connect to the X server at all. Reported by yevlempy on sugar-devel:

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?

Xephyr cannot open host display. Is DISPLAY set?
xrdb: No such file or directory
xrdb: Can't open display ':39'
Window manager error: Unable to open X display :39
1267079814.2631569 STARTUP: Starting the shell
Traceback (most recent call last):
  File "/home/Rinki/project/sugar-jhbuild/install/bin/sugar-session", line 32, in <module>
    import gtk
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
    _init()
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
    _gtk.init_check()
RuntimeError: could not open display
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/Rinki/project/sugar-jhbuild/install/lib/python2.6/site-packages/jarabe/util/emulator.py", line 156, in main
    _kill_pipe(server)
  File "/home/Rinki/project/sugar-jhbuild/install/lib/python2.6/site-packages/jarabe/util/emulator.py", line 80, in _kill_pipe
    os.kill(pipe.pid, signal.SIGTERM)
AttributeError: 'NoneType' object has no attribute 'pid'

Attachments (1)

1755.patch (2.6 KB) - added by sascha_silbe 10 years ago.
sugar-emulator: better error messages in case of failures

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by sascha_silbe

  • Keywords r? added
  • Status changed from new to accepted

comment:2 Changed 11 years ago by erikos

  • Milestone changed from 0.88 to 0.88.x

No show stopper.

comment:3 follow-up: Changed 10 years ago by tomeu

  • Keywords r! added; r? removed

+ sys.stderr.write('Error executing server: %s\n' % (exc, ))

Better print the full exception including the traceback? If cannot use logging.error, then see in http://docs.python.org/library/traceback.html .

+ if not pipe:
+ if not server:

Always use "is None", classes implementing a collection protocol evaluate to False when empty.

Changed 10 years ago by sascha_silbe

sugar-emulator: better error messages in case of failures

comment:4 in reply to: ↑ 3 ; follow-up: Changed 10 years ago by sascha_silbe

  • Cc tomeu added
  • Keywords r? added; r! removed

Replying to tomeu:

+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?

That will add no useful information and instead confuse the user.

+ if not pipe:
+ if not server:
Always use "is None", classes implementing a collection protocol evaluate to False when empty.

Changed.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 10 years ago by tomeu

Replying to sascha_silbe:

Replying to tomeu:

+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?

That will add no useful information and instead confuse the user.

I don't agree with this, asked in the ml for opinions.

comment:6 in reply to: ↑ 5 Changed 10 years ago by tomeu

  • Keywords r+ added; r? removed
  • Resolution set to fixed
  • Status changed from accepted to closed

Replying to tomeu:

Replying to sascha_silbe:

Replying to tomeu:

+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?

That will add no useful information and instead confuse the user.

I don't agree with this, asked in the ml for opinions.

Not such a big deal, pushed as http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/cb4fdde40a5

comment:7 Changed 10 years ago by sascha_silbe

Thanks!

comment:8 Changed 7 years ago by dnarvaez

  • Milestone 0.88.x deleted

Milestone 0.88.x deleted

Note: See TracTickets for help on using tickets.