rharriso / pywo

Automatically exported from code.google.com/p/pywo
GNU General Public License v3.0
0 stars 0 forks source link

Xlib.error.DisplayConnectionError: Can't connect to display ":0.0": [Errno 2] No such file or directory #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
 1. Execute pywo at the command line

What is the expected output? What do you see instead?

 I would expect pywo to run. Instead, it crashes with an X error, even when doing "pywo --help".

What version of the product are you using? On what operating system?

 I'm using revision 202 from the SVN repository. I'm running 64-bit Ubuntu Oneiric, in "Gnome classic 2d" mode.

Please provide any additional information below.

 pywo was working great for me for about two weeks. Then this morning I ran some apt updates and rebooted, and afterward I found that pywo crashes with the following error whenever I try to launch it. Launching it with "pywo --daemon" or even "pywo --help" has the same effect. (I am able to launch and run other python applications with a GUI, such as gpodder.)

> pywo
Traceback (most recent call last):
  File "/usr/local/bin/pywo", line 9, in <module>
    load_entry_point('PyWO==0.3.0', 'console_scripts', 'pywo')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 305, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2245, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1955, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/main.py", line 29, in <module>
    from pywo import actions, commandline
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/actions/__init__.py", line 34, in <module>
    from pywo.actions.core import TYPE_FILTER, STATE_FILTER, TYPE_STATE_FILTER
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/actions/core.py", line 25, in <module>
    from pywo.core import Window, WindowManager, Type, State, Mode
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/core/__init__.py", line 34, in <module>
    from pywo.core.windows import Type, State, Mode, Window, WindowManager
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/core/windows.py", line 40, in <module>
    from pywo.core.xlib import XObject
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/core/xlib.py", line 43, in <module>
    class XObject(object):
  File "/usr/local/lib/python2.7/dist-packages/PyWO-0.3.0-py2.7.egg/pywo/core/xlib.py", line 52, in XObject
    __DISPLAY = Display()
  File "/usr/lib/pymodules/python2.7/Xlib/display.py", line 83, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/lib/pymodules/python2.7/Xlib/display.py", line 65, in __init__
    apply(protocol.display.Display.__init__, (self, ) + args, keys)
  File "/usr/lib/pymodules/python2.7/Xlib/protocol/display.py", line 49, in __init__
    self.socket = connect.get_socket(name, host, displayno)
  File "/usr/lib/pymodules/python2.7/Xlib/support/connect.py", line 79, in get_socket
    return mod.get_socket(dname, host, dno)
  File "/usr/lib/pymodules/python2.7/Xlib/support/unix_connect.py", line 92, in get_socket
    raise error.DisplayConnectionError(dname, str(val))
Xlib.error.DisplayConnectionError: Can't connect to display ":0.0": [Errno 2] 
No such file or directory

 I don't know whether the packages I upgraded are causing the error or not, but here is the list of what I upgraded just before this started:

1. upgrade linux-image-3.0.0-15-generic 3.0.0-15.24 3.0.0-15.25
2. upgrade ubuntu-docs 11.10.5 11.10.6
3. upgrade language-selector-gnome 0.56 0.56.1
4. upgrade language-selector-common 0.56 0.56.1
5. upgrade binutils 2.21.53.20110810-0ubuntu5 2.21.53.20110810-0ubuntu5.1
6. upgrade firefox-globalmenu 8.0+build1-0ubuntu0.11.10.3 
9.0.1+build1-0ubuntu0.11.10.2
7. upgrade firefox 8.0+build1-0ubuntu0.11.10.3 9.0.1+build1-0ubuntu0.11.10.2
8. upgrade firefox-gnome-support 8.0+build1-0ubuntu0.11.10.3 
9.0.1+build1-0ubuntu0.11.10.2
9. upgrade firefox-locale-en 8.0+build1-0ubuntu0.11.10.3 
9.0.1+build1-0ubuntu0.11.10.2
10. upgrade linux-headers-3.0.0-15 3.0.0-15.24 3.0.0-15.25
11. upgrade linux-headers-3.0.0-15-generic 3.0.0-15.24 3.0.0-15.25
12. upgrade linux-libc-dev 3.0.0-15.24 3.0.0-15.25
13. upgrade xul-ext-ubufox 1.0-0ubuntu2.1 1.0.2-0ubuntu0.11.10.1

Original issue reported on code.google.com by aaronwells on 3 Jan 2012 at 10:04

GoogleCodeExporter commented 9 years ago
Seems to be a problem with python-xlib connecting with display.

What is the output of:
echo $DISPLAY

If it's something different than ":0.0" try changing in pywo/core/xlib.py line:
__DISPLAY = Display()
to:
__DISPLAY = Display(':1.1')
replacing ':1.1' with whatever is the output of "echo $DISPLAY"

Original comment by kosci...@gmail.com on 3 Jan 2012 at 10:26

GoogleCodeExporter commented 9 years ago
Thanks for the quick reply! "echo $DISPLAY" does output ":0.0".

> echo $DISPLAY
:0.0

It looks like it is a problem with python-xlib. I installed another program 
that has it as a dependency, and it crashes with the same error message.

Original comment by aaronwells on 3 Jan 2012 at 10:39

GoogleCodeExporter commented 9 years ago
Yeah, rolling back to linux headers 3.0.0-14 solves the problem. So, I think 
this is an upstream bug, not a pywo issue.

Original comment by aaronwells on 3 Jan 2012 at 11:02

freealong commented 8 years ago

To temporarily fix it, run xhost +

haymanyu commented 8 years ago

@freealong Works great.

FeelsBadMan1 commented 3 years ago

almost the same thing happens to me but no given solution works. the output of echo $DISPLAY is: :0