Upendra Kumar added the comment:

I am trying something similar to BrownTruck in issue : 
https://github.com/pypa/pip/pull/3733

I tried to execute pip.main('install','-U',<some_package>) from a thread.
I got a similar error : 

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 
299, in run
    requirement_set.prepare_files(finder)
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 370, 
in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 476, 
in _prepare_file
    with indent_log():
  File "/usr/lib/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.4/dist-packages/pip/utils/logging.py", line 34, 
in indent_log
    _log_state.indentation += num
AttributeError: '_thread._local' object has no attribute 'indentation'

There is some problem with threading.local() in pip.utils.logging. Can anyone 
please suggest a workaround for it. It is necessary for me to use threads other 
than the main GUI thread to update text. I need to update text and do long 
processes ( like searching for results using pip search command or installing 
or uninstalling) when someone presses a button.

When I don't use threading to update text, the GUI text is updated only after 
the callback returns.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27051>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to