lugensa / scorched

Sunburnt offspring solr client
MIT License
27 stars 19 forks source link

SSL connection requires byte strings, not Unicode literals #50

Closed quinot closed 7 years ago

quinot commented 7 years ago

Fix type of JSON string literals for administrative commands (commit, optimize, rollback).

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 95.742% when pulling 02fc7d6d5afa743fb8be4181b009bc8ad582b8dc on quinot:bug/ssl_unicode_literal into 329a04cfedbce190ce47d4ae31f5c0eb10cb2869 on lugensa:master.

delijati commented 7 years ago

All tests are running with and without the b so no real need to change this.

quinot commented 7 years ago

Well, that's not what I've been seeing. Are you testing with Python 2.7?

Traceback (most recent call last):
[...]
  File "/reportd/gnos-3.0w-20161122-x86_64-linux-bin/lib/site-python/scorched/connection.py", line 400, in commit
    softCommit=softCommit))
  File "/reportd/gnos-3.0w-20161122-x86_64-linux-bin/lib/site-python/scorched/connection.py", line 122, in update
    response = self.request('POST', url, data=body, headers=headers)
  File "/reportd/gnos-3.0w-20161122-x86_64-linux-bin/lib/site-python/scorched/connection.py", line 71, in request
    return self.http_connection.request(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 362, in send
    timeout=timeout
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 516, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 308, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 1039, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1073, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1035, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 883, in _send_output
    self.send(message_body)
  File "/usr/lib/python2.7/httplib.py", line 855, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 208, in sendall
    return self.connection.sendall(data)
  File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 969, in sendall
    raise TypeError("buf must be a byte string")
TypeError: buf must be a byte string
quinot commented 7 years ago

Hello, can you give a status update on this pull request?

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 95.763% when pulling eecdf9f47eee0f8e4a623c7daed116603211da69 on quinot:bug/ssl_unicode_literal into f8d864e5ad390a1b5a77c885cf27fbde6e187ee1 on lugensa:master.

delijati commented 7 years ago

As mentioned above this seams unrelated with scorched. Here some google results: