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

Re-use the open filehandle rather than open a new one. #112

Merged
merged 28 commits into from Mar 27, 2017

Conversation

robottwo
Copy link
Contributor

This is a permanent fix to the issue in #109 and #110.

Daniel Eisner and others added 23 commits November 29, 2016 11:51
This patch adds support for custom S3 servers in the connection string.
It also adds explicit support for setting the server port, and whether
or not to use SSL, both as paramaters to the smart_open function as
well as within the connection string.

These changes are neccessary to be able to connect to s3proxy and
other custom s3 servers which don't run on the default port,
or neccessarily use SSL.
 into RaRe-Technologies-master

Conflicts:
	smart_open/tests/test_smart_open.py
Adds support for opening vanilla HTTP and HTTPS addresses.
Supports efficient streaming, gzip and bz2 compression,
as well as Kerberos and username/password (basic) http
authentication.
We still want to maintain Python 2.6 compatibility,
so don't rely on contextlib.closing.
Now they don't require internet access, and will test for
Basic authentication in the HTTP header.
http => https, and remove old versions of the tests.
Conflicts:
	CHANGELOG.rst
	smart_open/smart_open_lib.py
This allows one to use any filehandle-like object instead of
just local posix. It also avoids unneccessary filesystem syscalls.
@tmylk
Copy link
Contributor

tmylk commented Mar 17, 2017

New unit tests for compressed files via http are needed. And the re-use of file handle test too.

This breaks out the http tests into their own test class.

Also fixed a few behaviors in the HttpReader uncovered by
the new tests (yay).
Works now on Python 2 as well as Python 3.
@robottwo
Copy link
Contributor Author

OK -- the lastest version add unit tests for .gz and .bz2 over HTTP. It also fixes a couple of issues discovered by those tests.

@tmylk
Copy link
Contributor

tmylk commented Mar 27, 2017

Thanks for the fix. Will merge as is.
Will create another wishlist item to test for the absence of file handle leak.

@tmylk tmylk merged commit 7b2c879 into piskvorky:master Mar 27, 2017
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.

None yet

2 participants