seveas / git-spindle

Abandoned command-line interface to GitHub and other central git services
Other
172 stars 35 forks source link

Exception on "git hub pull-request" for already existing pull-request #121

Closed Vampire closed 7 years ago

Vampire commented 8 years ago
Traceback (most recent call last):
  File "C:\Program Files\Python35\lib\site-packages\gitspindle\github.py", line 1203, in pull_request
    pull = parent.create_pull(base=dst, head='%s:%s' % (repo.owner.login, src), title=title, body=body)
  File "C:\Program Files\Python35\lib\site-packages\github3\decorators.py", line 38, in auth_wrapper
    return func(self, *args, **kwargs)
  File "C:\Program Files\Python35\lib\site-packages\github3\repos\repo.py", line 723, in create_pull
    return self._create_pull(data)
  File "C:\Program Files\Python35\lib\site-packages\github3\repos\repo.py", line 298, in _create_pull
    json = self._json(self._post(url, data=data), 201)
  File "C:\Program Files\Python35\lib\site-packages\github3\models.py", line 100, in _json
    if self._boolean(response, status_code, 404) and response.content:
  File "C:\Program Files\Python35\lib\site-packages\github3\models.py", line 121, in _boolean
    raise GitHubError(response)
github3.models.GitHubError: 422 Validation Failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python35\Scripts\git-hub", line 11, in <module>
    GitHub().main()
  File "C:\Program Files\Python35\lib\site-packages\gitspindle\__init__.py", line 344, in main
    func(opts)
  File "C:\Program Files\Python35\lib\site-packages\gitspindle\github.py", line 1206, in pull_request
    filename = self.backup_message(title, body, 'pull-request-message-')
  File "C:\Program Files\Python35\lib\site-packages\gitspindle\__init__.py", line 254, in backup_message
    fd.write(msg.encode('utf-8'))
TypeError: write() argument must be str, not bytes
adamk33n3r commented 7 years ago

Python3 expects the arg to write to be a string not bytes.

Vampire commented 7 years ago

@adamk33n3r yes, that's exactly what my PR is fixing

seveas commented 7 years ago

Cherry-picked the PR