Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[meta] track feature parity between py2/3 #96

Open
6 of 28 tasks
temoto opened this issue Mar 21, 2018 · 0 comments
Open
6 of 28 tasks

[meta] track feature parity between py2/3 #96

temoto opened this issue Mar 21, 2018 · 0 comments

Comments

@temoto
Copy link
Member

temoto commented Mar 21, 2018

Let's fill this table with everything known to be different between py2/3.

Solve by take py3 version

  • [proxy] py2: socks imported from vendored socksipy; py3: socks is first searched in installed packages, then vendored
  • HTTPConnectionWithTimeout py2: bug socket.error rewrap into new instance, loosing traceback, errno
  • HTTPSConnectionWithTimeout (TLS)
    • py2: bug socket.error rewrap into new instance, loosing traceback, errno
  • Response only py3 merges same name headers with comma
  • Http (public API)
    • __init__ deprecate ssl_version kwarg from py2; add custom SSLContext
    • _conn_request py3 handles ResponseNotReady from conn.getresponse()
    • _conn_request py3 handles socket.timeout from conn.getresponse() but doesn't retry
    • request py3 handles =?...?= encoding in cached response headers

Solve

  • [proxy] support callable proxy_info(scheme)
  • Http (public API)
    • request py3 passes https parameters based on subclass(HTTPSConnectionWithTimeout), opposed to simple scheme == 'https' check in py2, (temoto) IMHO should check both
  • AppEngine support is straight up absent on py3, take from py2 Add Google App Engine support to py3 fork #107

Figure out

  • _updateCache py3 handles UnicodeEncodeError with a weird dance
  • HttpsConnectionWithTimeout (TLS)
    • py2: custom cert CN to hostname verificator, copypasted from Google Appengine SDK
    • py3: likely bug socket.connect ignores address from getaddrinfo, connects to self.host,port
    • py3.3: sock.shutdown() on ssl.match_hostname error - it's either shutdown is redundant or fd leak until remote closes socket
    • py2: (connect) special handling of ssl.SSL_ERROR_SSL -> raise SSLHandshakeError
  • exceptions py2 unique:
    • SSLHandshakeError
    • CertificateValidationUnsupported, CertificateHostnameMismatch
    • NotSupportedOnThisPlatform
    • NotRunningAppEngineEnvironment
  • class Http (public API)
    • _conn_request py2 checks hasattr(conn, sock)
    • _conn_request py2 handles ssl_SSLError
    • _conn_request different way to read errno from socket.error
    • _conn_request py2 handles ECONNREFUSED
    • _conn_request py3 double conn.close() on socket.error from conn.getresponse()
    • request py2 proxy_info = self._get_proxy_info(scheme, authority)

TODO write tests

  • safename bytes input
  • _entry_disposition request cache-control max-age not a number
  • _entry_disposition request cache-control min-fresh not a number
  • _entry_disposition response cache-control max-age not a number
  • _updateCache info.as_string fail with UnicodeEncodeError
  • DigestAuthentication challenge qop invalid value
  • DigestAuthentication challenge algorithm invalid value
  • HmacDigestAuthentication
  • WsseAuthentication
  • GoogleLoginAuthentication
  • repr(ProxyInfo)
  • proxy_info_from_environment method not http,https
  • proxy_info_from_url blabla@host without :password part
  • HTTPSConnectionWithTimeout using proxy
  • HTTPSConnectionWithTimeout except (ssl.SSLError,...): if self.sock: self.sock.close()
  • HTTPSConnectionWithTimeout socket.timeout, gaierror
  • Http.clear_credentials
  • Http._conn_request socket.timeout
  • Http._conn_request conn.request -> http.client.HTTPException
  • Http._conn_request conn.getresponse -> except (socket.error, http.client.HTTPException)
  • Http._request on redirect strip headers if-none-match, if-modified-since, authorization
  • Http.request uri http://domain:443
  • Http.request uri bytes Some HTTP requests fail if "uri"type is "bytes" #225
  • Http.request header encoding =?...?=
  • Http.request from cache with -x-permanent-redirect-url while redirect limit overflow
  • Http.request on 304 preserve .stale_digest from cache
  • Http.request from cache stale/transparent new response not 200,304 -> cache.delete
  • Response .dict = self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant