You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem is that urllib3 now calls into httpretty.core.fakesock.socket.__getattr__ with "shutdown", which raises an error with httpretty.enable(allow_net_connect=False):
________________ApplicationOAuth.testEnterpriseGetAccessToken_________________self=<tests.ApplicationOAuth.ApplicationOAuthtestMethod=testEnterpriseGetAccessToken>deftestEnterpriseGetAccessToken(self):
>access_token=self.ent_app.get_access_token("oauth_code_removed", state="state_removed")
tests/ApplicationOAuth.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
github/ApplicationOAuth.py:137: inget_access_token*self._requester.requestJsonAndCheck(
github/Requester.py:586: inrequestJsonAndCheckreturnself.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
github/Requester.py:856: inrequestJsonreturnself.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
github/Requester.py:977: in__requestEncodestatus, responseHeaders, output=self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input)
github/Requester.py:1011: in__requestRawresponse=cnx.getresponse()
tests/Framework.py:254: ingetresponseresponse=self.__cnx.getresponse()
github/Requester.py:265: ingetresponser=verb(
/usr/lib/python3.13/site-packages/requests/sessions.py:637: inpostreturnself.request("POST", url, data=data, json=json, **kwargs)
/usr/lib/python3.13/site-packages/requests/sessions.py:589: inrequestresp=self.send(prep, **send_kwargs)
/usr/lib/python3.13/site-packages/requests/sessions.py:703: insendr=adapter.send(request, **kwargs)
/usr/lib/python3.13/site-packages/requests/adapters.py:668: insendresp=conn.urlopen(
/usr/lib/python3.13/site-packages/urllib3/connectionpool.py:787: inurlopenresponse=self._make_request(
/usr/lib/python3.13/site-packages/urllib3/connectionpool.py:534: in_make_requestresponse=conn.getresponse()
/usr/lib/python3.13/site-packages/urllib3/connection.py:513: ingetresponse_shutdown=getattr(self.sock, "shutdown", None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self=httpretty.core.socket("my.enterprise.com:80"), name='shutdown'def__getattr__(self, name):
ifnamein ('getsockopt', 'selected_alpn_protocol') andnotself.truesock:
self.truesock=self.create_socket()
elifhttpretty.allow_net_connectandnotself.truesock:
# can't call self.connect_truesock() here because we# don't know if user wants to execute server of client# calls (or can they?)self.truesock=self.create_socket()
elifnotself.truesock:
# Special case for# `hasattr(sock, "version")` call added in urllib3>=1.26.ifname=='version':
raiseAttributeError(
"HTTPretty synthesized this error to fix urllib3 compatibility ""(see issue https://github.com/gabrielfalcao/HTTPretty/issues/409). ""Please open an issue if this error causes further unexpected issues."
)
>raiseUnmockedError('Failed to socket.{} because because a real socket does not exist'.format(name))
Ehttpretty.errors.UnmockedError: Failedtosocket.shutdownbecausebecausearealsocketdoesnotexistEETip: Youcouldtrysetting (allow_net_connect=True) toallowunregisteredrequeststhrougharealTCPconnectioninadditionto (verbose=True) todebugtheissue.
/usr/lib/python3.13/site-packages/httpretty/core.py:894: UnmockedError
Problem is that urllib3 now calls into
httpretty.core.fakesock.socket.__getattr__
with"shutdown"
, which raises an error withhttpretty.enable(allow_net_connect=False)
:PyGithub/PyGithub#3101
The text was updated successfully, but these errors were encountered: