asyncio-tkinter icon indicating copy to clipboard operation
asyncio-tkinter copied to clipboard

'Future' object has no attribute '_copy_state'

Open jbarlow83 opened this issue 9 years ago • 3 comments

In either tkapp.py or tkapp2.py, clicking the "Count Words" or "Call with futures" button respectively (both of which use futures) gives the following error in Python 3.5:

exception calling callback for <Future at 0x10e9242b0 state=finished returned list>
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/concurrent/futures/_base.py", line 297, in _invoke_callbacks
    callback(self)
  File ".../asyncio-tkinter/guievents.py", line 43, in <lambda>
    self.call_soon_threadsafe(new_future._copy_state, future))
AttributeError: 'Future' object has no attribute '_copy_state'

jbarlow83 avatar Oct 29 '16 01:10 jbarlow83

See here for how the (internal) API changed in Py3.5. Not sure why it's necessary to call an internal API function.

jbarlow83 avatar Oct 29 '16 01:10 jbarlow83

Annoying for sure, new code -> self.call_soon_threadsafe( futures._copy_future_state, future, new_future))

timeyyy avatar Dec 09 '16 16:12 timeyyy

maybe yield from extracts you the right value

NG-Bullseye avatar Apr 17 '18 16:04 NG-Bullseye