Requester.__requestRaw() was handling 301 redirects by passing the full
URL to itself, when it only expects a URL path, so parse out the path,
and pass that in. Add a test for this behaviour.
Closes: #906
* Handle HTTP 202
Fixes#564
After some testing, it seems GitHub seems to be able to process the chrunching of statistics
for every repository I tested in around 2 seconds. So a delay of around 5 seconds should be
plenty to be very certain that the next try should succeed.
Another option would be to put this value lower and possibly waste an extra retry on it.
* Only re-request data if HEAD or GET (those are 'safe')
to e.g. avoid running a duplicate POST or PUT, that can change stuff on the server
Using RFC 2616 and https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html as guideline
* Fix testStatistics
* change wait time to 2 secs
In the old code the self.__hostname would be overwritten with uploads.github.com
but it could not be correctly re-set to api.github.com after completing the upload
Create a separate connection if hostname or port differ in requestBlobAndCheck
in the end this became quite a large overhaul, to also make this change generic
for e.g. connecting to status.github.com and similar methods
~~not sure if tests need (more) updating, if so I will update the PR accordingly~~
* works (but tests fail)
* Refactor to use python requests rather than httplib
* add requests dependency in setup.py
* touch so travis-ci will run
* clean up some unused comments
* Handle HTTP vs HTTPS; handle custom base_url
* Use requests session
* Don't use a persistent session in tests (which don't use the real requests library)
* Use an older version of requests for python 3.2
Requests dropped support for Python 3.2 in the 2.10 series (though it
didn't detect this until 2.11).
PyGithub probably doesn't need to support Python 3.2 at all; it's quite
old, with negligably few users, but that should be addressed elsewhere.
* Revert "Use an older version of requests for python 3.2"
This reverts commit fb0367614f5413968eeab98f4094e710aa1bc2d1.
* Improve readability
* Update requirements.txt
* Disable custom proxy handling code (unneeded and broken); use requests'
* Remove comment and superflous code
* Fix iteritems() removal from Python3
* pin requests to 2.14.0 or greater in prep for no_proxy
* pin requests to 2.14.0 or greater in prep for no_proxy
github.AuthenticatedUser.create_authorization has been modified to
support two-factor authentication. When two-factor authentication
is enabled create_authorization will throw an TwoFactorException.
The onetime password can be then be passed to create_authorization
on a subsequent call.