collective / collective/collective.developermanual

httplib.BadStatusLine: '' - probably changes of GitHub API affecting the script

Open
#212 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
81
Forks
104
PR merge metrics
No merged PRs in 30d

Description

I managed to run the script with the correction I made (see https://github.com/collective/collective.developermanual/pull/211) but it failed on the `create_issue` method https://github.com/collective/collective.developermanual/blob/master/gh-issues-import.py#L196 with the message

`httplib.BadStatusLine: ''`

The basic authentication works fine for getting the collection of issues to be exported to the cloned repository, but then it seems like that doesn't work for post while creating the issue. Could it be that GitHub API doesn't allow it anymore?

The full log:

```
Loaded issues 1 30
Loaded issues 2 1
Loaded issues 3 0
Importing issue Here is the name of the issue on GitHub I want to export (59)
Traceback (most recent call last):
File "/gh-issues-import.py", line 274, in
main()
File "/gh-issues-import.py", line 270, in main
import_issues(issues, milestones, labels)
File "/gh-issues-import.py", line 138, in import_issues
import_issue(source, dst_milestones, dst_labels)
File "/gh-issues-import.py", line 169, in import_issue
res_issue = create_issue(dst_url, source["title"], body, assignee, milestone, labels)
File "/gh-issues-import.py", line 197, in create_issue
res = urllib2.urlopen(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1207, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1170, in do_open
r = h.getresponse(buffering=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1027, in getresponse
response.begin()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with gh-issues-import.py at create_issue around line 196 and compare its POST request with the earlier authenticated issue-collection requests. Re-run the importer using the supplied example and inspect whether the create request receives a response; done means the issue is created successfully rather than raising httplib.BadStatusLine.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.