This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author upendra-k14
Recipients dstufft, lorenzogotuned, ncoghlan, ned.deily, rhettinger, terry.reedy, upendra-k14
Date 2016-06-26.13:41:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466948472.23.0.659074718013.issue27051@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-06-26 13:41:12upendra-k14setrecipients: + upendra-k14, rhettinger, terry.reedy, ncoghlan, ned.deily, dstufft, lorenzogotuned
2016-06-26 13:41:12upendra-k14setmessageid: <1466948472.23.0.659074718013.issue27051@psf.upfronthosting.co.za>
2016-06-26 13:41:12upendra-k14linkissue27051 messages
2016-06-26 13:41:11upendra-k14create