Skip to content

Make splunklin.binding.ResponseReader.readline function.#121

Closed
cjw296 wants to merge 1 commit intosplunk:masterfrom
cjw296:readline_bug
Closed

Make splunklin.binding.ResponseReader.readline function.#121
cjw296 wants to merge 1 commit intosplunk:masterfrom
cjw296:readline_bug

Conversation

@cjw296
Copy link
Copy Markdown

@cjw296 cjw296 commented Oct 16, 2015

I bumped into this trying to do:

>>> conn = client.connect(...)
>>> result = conn.jobs.export('search ...', output_mode='csv')
>>> result.readline()
'"'

The problem is the 1 byte peek followed by a one byte read here:

https://hg.python.org/cpython/file/v2.7.5/Modules/_io/iobase.c#l466

This results in an attempt to read 0 bytes from the HTTPResponse in result._response, which ends up hitting this code path:

https://hg.python.org/cpython/file/v2.7.5/Lib/httplib.py#l567

We ask for 0 bytes, and sure enough, we get 0 bytes, but httplib sees this as "no data left" and closes the connection.

I couldn't figure out how best to test this, or indeed, how to run the test suite in such a way that the existing tests on HEAD of master all passed before I started work. But, functional testing has shown this to work.

@itay
Copy link
Copy Markdown
Contributor

itay commented Nov 21, 2015

@cjw296 sorry for the delayed response. Could you:

  1. Sign the contribution agreement?
  2. Rebase this on top of develop (and change the target to be develop), so that you pick up the Travis CI tests?

@cjw296
Copy link
Copy Markdown
Author

cjw296 commented Nov 22, 2015

Given this software is so poor, I'm unlikely to bother with a wet-ink contributor agreement.
You can do you own rebasing.
Take it or leave it...

@cjw296 cjw296 closed this Nov 22, 2015
mateusz834 added a commit that referenced this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants