Skip to content

Exception if attempting to merge with empty commit message #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jdiez17 opened this issue Apr 6, 2015 · 5 comments
Closed

Exception if attempting to merge with empty commit message #370

jdiez17 opened this issue Apr 6, 2015 · 5 comments
Labels

Comments

@jdiez17
Copy link

jdiez17 commented Apr 6, 2015

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jdiez/dev/SIGSERV/sigserv/bot.py", line 58, in main
    process_pr(pr, issue, repo['file'])
  File "/home/jdiez/dev/SIGSERV/sigserv/bot.py", line 39, in process_pr
    pr.merge()
  File "/home/jdiez/dev/SIGSERV/lib/python3.4/site-packages/github3/decorators.py", line 38, in auth_wrapper
    return func(self, *args, **kwargs)
  File "/home/jdiez/dev/SIGSERV/lib/python3.4/site-packages/github3/pulls.py", line 315, in merge
    json = self._json(self._put(url, data=data), 200)
  File "/home/jdiez/dev/SIGSERV/lib/python3.4/site-packages/github3/models.py", line 100, in _json
    if self._boolean(response, status_code, 404) and response.content:
  File "/home/jdiez/dev/SIGSERV/lib/python3.4/site-packages/github3/models.py", line 121, in _boolean
    raise GitHubError(response)
github3.models.GitHubError: 400 Problems parsing JSON
@sigmavirus24
Copy link
Owner

Any chance of providing more detai lthan that? What version of github3.py you're using? Anything about the code you're using? etc.

@jdiez17
Copy link
Author

jdiez17 commented Apr 6, 2015

Version is github3.py==0.9.3. Code is nothing special, just attempts to merge a PR without a message. The problem seems to be in pulls.py, lines 310-314. data is initialised as None, but is converted to a JSON string if the commit_message variable is present.

@sigmavirus24
Copy link
Owner

Would appear GitHub changed their API. The commit message used to be optional but it looks like now they want the attribute there but with an empty string to accept the default.

@jdiez17 would you like to submit a fix for this?

@chkumar246
Copy link

May i take this bug?

@sigmavirus24
Copy link
Owner

You may

antoine-g added a commit to antoine-g/github3.py that referenced this issue Jun 15, 2015
The GitHub API now requires a param `commit_message` with an empty value ''
when merging a pull request. In such case the default value is used as a
commit message.
Providing an empty data string no longer works.
antoine-g added a commit to antoine-g/github3.py that referenced this issue Jun 16, 2015
Fixes sigmavirus24#370

The GitHub API now requires a param `commit_message` with an empty value ''
when merging a pull request. In such case the default value is used as a
commit message.
Providing an empty data string no longer works.
antoine-g added a commit to antoine-g/github3.py that referenced this issue Jun 16, 2015
Fixes sigmavirus24#370

The GitHub API now requires a param `commit_message` with an empty value ''
when merging a pull request. In such case the default value is used as a
commit message.
Providing an empty data string no longer works.

(cherry picked from commit 39c06c9)

Conflicts:
	tests/unit/test_pulls.py

The test file was not backported because it doesn't exist on the
destination branch.
Sriharivignesh pushed a commit to Sriharivignesh/github3.py that referenced this issue Nov 18, 2017
Fixes sigmavirus24#370

The GitHub API now requires a param `commit_message` with an empty value ''
when merging a pull request. In such case the default value is used as a
commit message.
Providing an empty data string no longer works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants