Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render is failling with latest Pweave #65

Open
rlaverde opened this issue Aug 31, 2017 · 4 comments
Open

Render is failling with latest Pweave #65

rlaverde opened this issue Aug 31, 2017 · 4 comments
Labels

Comments

@rlaverde
Copy link
Member

rlaverde commented Aug 31, 2017

Render is failing with: signal only works in main thread after this pweave change: mpastell/Pweave@3765b0c

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/rlaverde/anaconda3/envs/spyder/lib/python3.5/site-packages/IPython/core/history.py", line 780, in writeout_cache
    self._writeout_input_cache(conn)
  File "/home/rlaverde/anaconda3/envs/spyder/lib/python3.5/site-packages/IPython/core/history.py", line 764, in _writeout_input_cache
    (self.session_number,)+line)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140131990218496 and this is thread id 140134640838400
@rlaverde
Copy link
Member Author

Maybe this is related:
scrapy/scrapy@8d77005

I think that WorkerManager is doing something with the workers that cause it the thread to change, or maybe is because it's use QThread

@rlaverde
Copy link
Member Author

I've finally found the bug, It's caused because the workermanager change the worker thread in _start() method https://github.com/spyder-ide/spyder/blob/master/spyder/utils/workers.py#L264

Using instead the logic for ProcessWorker, fix the bug (although that doesn't seem as the best solution)

cc: @goanpeca

@rlaverde
Copy link
Member Author

I think that the only solution is to move to use ProcessWorker, I'll further investigate if there is other solution before doing that.

@goanpeca
Copy link
Member

@rlaverde moving forward with spyder handling envs, and other python versions, we will most likely rely on the LSP or the process worker since, the python worker only really makes sense for things that will be executed in the same environment that spyder lives. I know this is a different issue, but it is probably more reliable to do it using the process worker, although it might take a little more time (while a new python process is started). You can also have a helper script that runs PWeave and execute that script in a process if that makes things easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants