#22 Traceback when change_issue_status method is used (even if method is sucessfull)
Closed: Fixed 2 years ago Opened 2 years ago by mbasti.

I successfully closed ticket using libpagure, but I got following exception.

In [10]: p.change_issue_status(6850, "Closed")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-25e822b65218> in <module>()
----> 1 p.change_issue_status(6850, "Closed")

/usr/lib/python3.5/site-packages/libpagure/libpagure.py in change_issue_status(self, issue_id, new_status, close_status)
    437                                       method='POST', data=payload)
    438 
--> 439         if not return_value['message'].startswith("Successfully"):
    440             raise Exception(return_value['message'])
    441 

AttributeError: 'list' object has no attribute 'startswith'

This is strange. The sample response in the Pagure API says

{
  "message": "Successfully edited issue #1"
}

The sample message in the Pagure API page seems to be outdated. We'll need to refer to the source code (under api/ dir)

HTTP response code may be enough for check if everything is okay. That message could be logged in DEBUG level if someone really wants to know what Pagure says for an operation, and in ERROR level when a request fails.

Metadata Update from @cqi:
- Issue assigned to cqi

2 years ago

Metadata Update from @cqi:
- Issue set to the milestone: 0.10

2 years ago

Metadata Update from @cqi:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata