Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56157 - bluez-utils: bluepin: patch does not work with xorg-x11
Summary: bluez-utils: bluepin: patch does not work with xorg-x11
Status: RESOLVED DUPLICATE of bug 66255
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 87407 (view as bug list)
Depends on: 35987
Blocks:
  Show dependency tree
 
Reported: 2004-07-05 11:39 UTC by Ioannis Aslanidis (RETIRED)
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bluepin.patch (bluepin.patch,455 bytes, patch)
2005-04-02 09:08 UTC, Ioannis Aslanidis (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-05 11:39:51 UTC
This bug is related to bug 35987.

It seems that the patch of bug 35987 only works for xfree, but it does not work with xorg-x11. Even though, it could be that the patch was not included in the latest version.

REPORT BELOW:

*  net-wireless/bluez-utils
      Latest version available: 2.7
      Latest version installed: 2.7
      Size of downloaded files: 276 kB
      Homepage:    http://bluez.sourceforge.net/
      Description: bluetooth utilities
      License:     GPL-2

# bluepin 
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Traceback (most recent call last):
  File "/usr/bin/bluepin", line 39, in ?
    import gtk
  File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line 43, in ?
    from _gtk import *
RuntimeError: could not open display


Reproducible: Always
Steps to Reproduce:
1. /usr/bin/bluepin
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2004-07-06 05:28:46 UTC
i don't think bluepin can be called via the commandline like that, are you sure it doesn't launch from hcid?
Comment 2 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-06 05:54:31 UTC
Hmmm... how do you expect me to do the PIN synchronization then? There is no utility that does so :( BTW, if you check bug 35987 or you google around you'll see what I mean.

bluepin tries to open an X window... but hci tools are all command line, so rather not :)
Comment 3 Alastair Tse (RETIRED) gentoo-dev 2004-07-06 06:22:17 UTC
hcid does launch bluepin via a command line. there is some magic in the script that detects the right display that the user on the console is using and displays the window there. 
Comment 4 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-06 06:25:06 UTC
My hcid stays in background, but launches no bluepin... :( Am I doing anything wrong? Which is the sequence/config you follow to achieve that?

-----

# hcid 
# bluepin 
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Traceback (most recent call last):
  File "/usr/bin/bluepin", line 39, in ?
    import gtk
  File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line 43, in ?
    from _gtk import *
RuntimeError: could not open display


-----
Comment 5 Martin Schönn 2004-07-09 10:38:00 UTC
I get the exact same error as Deathwing00
Comment 6 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-09 10:39:48 UTC
Use /etc/bluetooth/pin as a workaround... but also have a look at bug 35987
Comment 7 Florian Ehrenthal 2004-08-16 14:26:13 UTC
i had the same problem, but after installing pygtk-2.2 it forked nicely
so this is probably a version problem
Comment 8 Alastair Tse (RETIRED) gentoo-dev 2004-09-21 16:08:16 UTC
can't really hurt bumpign the dep to pygtk-2.2, committing this to 2.10-r1
Comment 9 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-10-17 04:15:21 UTC
Verified.
Comment 10 Henrik Brix Andersen 2005-01-08 14:28:56 UTC
Closing.
Comment 11 Ioannis Aslanidis (RETIRED) gentoo-dev 2005-04-02 08:44:18 UTC
*** Bug 87407 has been marked as a duplicate of this bug. ***
Comment 12 Ioannis Aslanidis (RETIRED) gentoo-dev 2005-04-02 08:45:19 UTC
Looks like the problem persists.
Comment 13 Ioannis Aslanidis (RETIRED) gentoo-dev 2005-04-02 09:08:07 UTC
Created attachment 55111 [details, diff]
bluepin.patch

Looks like I've found the problem:

*****

ioannis@bluehat ~ $ bluepin						     
Traceback (most recent call last):
  File "/usr/bin/bluepin", line 39, in ?
    import gtk
ImportError: No module named gtk
ioannis@bluehat ~ $ ./bluepin						       
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Traceback (most recent call last):
  File "./bluepin", line 39, in ?
    import gtk
  File "/usr/lib64/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line 37,
in ?
    from _gtk import *
RuntimeError: could not open display

*****


That was caused because 'import gtk' was placed _after_ the definition of a
function. After moving 'import gtk' to top, the script works. Even though that,
I am not sure that _that_ is the correct behaviour, please, somebody test it.

The patch I've proposed performs the changes.
Comment 14 Alastair Tse (RETIRED) gentoo-dev 2005-04-26 05:39:15 UTC

*** This bug has been marked as a duplicate of 66255 ***