Remove requests requirement, and use urllib built-in modules #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Mike, I'm experiencing issues with the
web_service
module, e.g.raises "ChunkedEncodingError: ("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))".
This error is the same on Windows and Linux using recentish packages from conda-forge.
Is this #29 and/or #30?
A fix (for me at least) is to simply replace Python Requests with the urllib built-in modules. It doesn't seem that the high-level features of Requests is warranted by this module, as it's pretty basic encode and retrieve data from a stream.
I've mostly rewritten
build_url
to build a dict of data that gets encoded once. The order of the dict should be preserved, even for Python 3.6, since most folks use CPython. (The insertion order is guaranteed from Python 3.7). The previousbuild_url
encoded parts, but not all. This will send perhaps different URLs. So, check carefully with your use-cases. Also interested to know how this change behaves with large data requests. I've only been using this module since yesterday, so I'm actually a novice with this package.