python Gtk app failed with this error xcb xlib threads sequence lost failed

970 Views Asked by At

I had a pyGObject app and I run that. all things work fine until on a button clicked signal I need to run a def. it has a long loop and I run that with the

def on_launch_btn_clicked(self,button): 
    _thread.start_new_thread(launch,["thread"])


def launch(thread):
    lines_list = open("../line.txt").split()
    for line in lines_list:
        select = machinestate.objects.get(id=1)
        if not select.pause:
            #my process
        else:
            def pause_lcd()
            return "pause" #it for come out of def and close thread but I don't know it close that or not

this loop is in another .py file

function it works like a charm, next I had a pause button it changes database pause field to True and my loop every iteration check database to saw what is changed. when it saw pause is True it run

def pause_lcd():
    app = app_list[0]
    app.pause_action()  

I run Gtk app in this def

app_list = list()
def main(thread):
    app = GUI()
    app_list.append(app)
    Gdk.threads_init()
    Gtk.main()

in my GUI class I have pause_action method

def pause_action(self):
    self.pause_btn.set_sensitive(True)
    self.pause_btn.hide()
    self.resume_btn.show()

when I clicked on pause button some time I got this error

[xcb] Unknown sequence number while processing queen
[xcb] Most likely this is a mulity-threaded client and XinitThreads has not been called
[xcb] Aborting, sorry about that
pyhton: ../../src/xcb_io.c:263 poll_for_event: Assertion '!xcb_xlib_threads_sequence_lost failed.

I had a bunch of thread side this threads like machine info, clock, machine temp and ...

what I do wrongs??

PS: this app run in a Django project and I use Django model in this it is an app of Django but it runs a Gtk app

1

There are 1 best solutions below

0
On

I suspect that something with the XCB or the X11 server is wrong (bug). I received the same error message from different applications on a specific X server (using X11 over ssh).

Error message with emacs:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
emacs: xcb_io.c:263: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Error message with eclipse:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
java: xcb_io.c:263: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.