question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: The current event queue and the main event queue are not the same.

See original GitHub issue

Version info

OSX 10.11.6 IPython 5.1.0 ITerm2 Build 3.0.7 Python 3.5.2

This might be a long shot since it’s kind of specific, but I thought I’d report it anyway. The following function is causing the error. It errors out in IPython, but not in a regular python3 shell session.

Function

TL;DR: The following description may be irrelevant, as the error is indicated as happening at the first call to input()

It essentially just prompts for a document number, then another document (ECR) number, and check if those ECRs have that Doc in a specific field in an sqlite table (the ismember function just checks for membership in a comma-delimited string, e.g. ismember('Doc-1', 'Doc-1,Doc-2,Doc-3') = True)

def doc_checks(db_path):
    """Check if a doc has inputted associated ECRs, supposedly"""
    ecrs=''
    doc=''
    db = sqlite3.connect(db_path)
    db.create_function("ismember",2,eu.ismember)
    cur = db.cursor()
    try:
        while True:
            doc = input('Enter a doc number: ')
            if doc=='stop':
                break
            while True:
                ecrs = input('Enter associated ECRs: ')
                if ecrs =='stop':
                    break
                ecrs = [ecr.strip() for i in ecrs.split(',')]
                cur.execute(
                    "UPDATE MasterECR SET RecordList = "
                    "CASE NOT ismember(?,RecordList) THEN RecordList||','||? "
                    "ELSE RecordList END "
                    "WHERE ECRNumber IN {0}"
                    .format('('+','.join('?'*len(ecrs))+')'),
                    (doc,doc,*ecrs)
                )

        db.commit()
    finally:
        db.close()

Error

This is the error being returned by IPython

Enter a doc number: 2016-08-15 15:57:20.677 Python[9739:1314371] !!! BUG: The current event queue and the main event queue are not the same. Events will not be handled correctly. This is probably because _TSGetMainThread was called for the first time off the main thread.
---------------------------------------------------------------------------
EOFError                                  Traceback (most recent call last)
<ipython-input-6-fcb666389ca2> in <module>()
----> 1 doc_checks('CAS/MasterData/MasterData.db')

/Users/diego/Dropbox (MIT)/JPL/Working/scratch.py in doc_checks(db_path)
     15     try:
     16         while True:
---> 17             doc = input('Enter a doc number: ')
     18             if doc=='stop':
     19                 break

EOFError:

As mentioned before, it runs normally on a regular python3 session, or at least this error does not occur.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Casyfillcommented, Aug 27, 2017

I have it all the time I use tab in ipython (not notebook): MacOS, python 3.6, zsh, conda virtualenv

4reactions
makmanalpcommented, May 3, 2017

Wait, it happened again! I think it’s happening when the autocomplete lags (which is very weird - it didn’t used to happen?)

lag

The pause is me hitting tab and then waiting for a while, and then typing a lot because the terminal isn’t responding. And then suddenly it responds. But perhaps these things are related and there’s something like a race condition.

Read more comments on GitHub >

github_iconTop Results From Across the Web

!!! BUG: The current event queue a… | Apple Developer Forums
Running my app from Xcode today I got this scary log: !!! BUG: The current event queue and the main event queue are...
Read more >
Developers - BUG: The current event queue and the main event ...
BUG: The current event queue and the main event queue are not the same. Events will not be handled correctly. This is probably...
Read more >
Future assigned to MicroTask or Event Queue? - Stack Overflow
In the first program, after the computation has been scheduled, the program goes on to print('End'); and main exits. At the later timer...
Read more >
The event loop - JavaScript - MDN Web Docs - Mozilla
The processing of functions continues until the stack is once again empty. Then, the event loop will process the next message in the...
Read more >
Understanding Event Loop, Call Stack, Event & Job Queue in ...
Event Loop : Then comes the Event Loop, which keeps running continuously and checks the Main stack, if it has any frames to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found