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

BufferedGzipFile in Python3.5 #1308

Closed
alvations opened this issue Feb 26, 2016 · 0 comments
Closed

BufferedGzipFile in Python3.5 #1308

alvations opened this issue Feb 26, 2016 · 0 comments

Comments

@alvations
Copy link
Contributor

On the CI tests for Python 3.5, BufferedGzipFile test is breaking at https://github.com/nltk/nltk/blob/develop/nltk/test/data.doctest#L327

This is because of the change in how buffer is read when code was modified from Python3.4 -> 3.5:

There's a new GzipFile._buffer variable in Python3.5 that clashes with nltk.data.BufferedGzipFile._buffer, so at https://github.com/nltk/nltk/blob/develop/nltk/data.py#L372 ,

Since by default Python3.5 uses a buffer reader, it should have the same functionality as nltk.data.BufferedGzipFile. Assuming that the core Python team don't backport this functionality, we should consider deprecating this when we start dropping python2.7 support.

Meanwhile I think the easiest fix is to refactor BufferedGzipFile._buffer to do something like BufferedGzipFile._nltk_buffer. And that should resolve Python3.4 -> 3.5 related issues for now =)

alvations added a commit that referenced this issue Feb 27, 2016
Resolves #1308

This will avoid the variable name class between nltk.data.BufferedGzipFile and native Python3.5 gzip.GzipFile.
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

No branches or pull requests

1 participant