Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Printing Promise objects from asynchronous Runner.run() raises Attribute Error

Open
#996 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start in invoke/runners.py, where Promise inherits Result and receives its str behavior. Reproduce the example with Runner.run(..., asynchronous=True), then verify that printing the returned Promise no longer raises AttributeError about exited while promise.join() still works.

Written by the indexing model from the issue text.

Description

@task
def test(c):
    promise = c.run("sleep 5", asynchronous=True)
    print(promise)
    promise.join()

As a new user of invoke, I noticed that when I would try to print the promise returned by a Runner.run call with asynchronous=True (see above code for an example), I would get the following error:

AttributeError: 'Promise' object has no attribute 'exited'

Looking at runners.py, it seems the issue is that since Promise is a subclass of Result, and so inherits its __str__ method.

Dominant language
Python
Stars
4.8k
Forks
412
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyinvoke/invoke

All issues in pyinvoke/invoke

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.