Comments (12)
Any news ?
from httpretty.
HTTPretty needs some TLC which I intend to work on ASAP 😬
from httpretty.
Yeah, I'm having the same problem (version 0.5.9). Using urllib2
, the following raises HTTPError
(if you trap the error and inspect it, you see a response code of 400 and the same message given above):
import urllib2
from httpretty import HTTPretty
url = 'https://www.cloudflare.com/ips'
HTTPretty.reset()
HTTPretty.enable()
response = urllib2.urlopen(url)
(I've been getting the same thing from a couple of other domains, too, so it's not specific to CloudFlare, though that error message seems to be specific to nginx.)
from httpretty.
This appears to be due to HTTPretty not implementing a proper SSL wrapper. ssl.wrap_socket
is replaced by fake_wrap_socket
, a no-op, when HTTPretty is enabled. It seems we must mock all HTTPS connections if HTTPretty is enabled, not just those matching our desired URIs.
from httpretty.
Has anyone come up with a workaround for this?
from httpretty.
I fixed this issue in my fork: https://github.com/pegler/httpretty I also added the ability to pass in a function to register_uri that accepts the data sent, so that it can respond to dynamically to what was sent instead of having to hardcode everything.
It was a long time ago, and I don't really remember making those changes.
from httpretty.
+1
Same problem, not sure how this issue is not a major critical bug.
from httpretty.
+1 this is fairly recent
from httpretty.
Hey, folks, please refrain from +1 or "thumbs up" or "me too" comments. Contrary to what it might appears to you, such comments are not productive and might even lead to the project owners disabling comments for the issue. We don't need this, really.
from httpretty.
@kostix sorry but this is def a way to prioritise issue priority and is quite commonly accepted.
I have managed to resolve the issue as there appears to be some conflict in the lib dependencies (as expected)..
deleted the vm and then recreate with unpinned dependencies should all resolve "nicely"
from httpretty.
Hey @rosscdh,
Do you mind sharing your fix?
from httpretty.
Hey Yarden,
Am afk atm but in brief. Reinstall brew OpenSSL and then reinstall all the
url requirements urllib3 requests requests[security] off the top of my
head..
Will send version numbers later
On Thursday, 24 March 2016, Yarden Sachs [email protected] wrote:
Hey @rosscdh https://github.com/rosscdh,
Do you mind sharing your fix?—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#35 (comment)
from httpretty.
Related Issues (20)
- 1.1.4: pytest is failing because missing `context` and `port` fixtures and some pytest warnings HOT 6
- httpretty.errors.UnmockedError: Failed to socket.setblocking because because a real socket does not exist HOT 1
- 1.1.4: sphinx warnings `reference target not found`
- Typing error when using callback as body
- State of project HOT 1
- test_httpretty_should_handle_paths_starting_with_two_slashes needs update HOT 2
- 1.1.4: Tests are failing on s390x because of "did not run within two miliseconds" HOT 1
- Document global allow_net_connect flag HOT 1
- Request body isn't decoded when client specifies its charset
- Link headers Example does not work
- Reset should blank latest_requests? HOT 1
- FakeSockFile: `'super' object has no attribute 'flush'` HOT 1
- urllib3.contrib.pyopenssl is being deprecated
- Requests upgrade to v2.29.0 causes the test case test_httpretty_should_allow_registering_regexes_with_streaming_responses to fail
- Why httpretty.enabled(context manager) effect is getting reset after it encounter @httpretty.activate ? HOT 1
- Long response time when calling unmatched requests
- httpretty silently fails with Python 3.12
- tox testing fails: *** No rule to make target 'test'. Stop.
- Recording requests does not work for non-UTF8 data
- Does httpretty support multi-threading? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpretty.