Skip to content

move queue size logic into a lock-protected block #351

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

Closed
wants to merge 5 commits into from

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Dec 4, 2018

This is a shot in the dark to fix #348 as I wasn't able to reproduce.

The idea is to move the size check into a code block that is protected by the thread lock, and also to make sure to check that fileobj exists.

@beniwohli beniwohli requested a review from axw December 4, 2018 09:43
this avoids some weird special cases, and maintains more or less the
same functionality, as GzipFile(compresslevel=0) also disables gzip
compression
we call a method of the object two lines up, so it's safe to assume that
it is not None. We _probably_ could also remove the check if
queued_data.fileobj is None, but I'm not 100% sure
beniwohli added a commit that referenced this pull request Dec 5, 2018
also, move queue size logic into a lock-protected block.

This avoids some weird special cases, and maintains more or less the
same functionality, as GzipFile(compresslevel=0) also disables gzip
compression
@beniwohli
Copy link
Contributor Author

closed in 4425fad

@beniwohli beniwohli closed this Dec 5, 2018
@beniwohli beniwohli deleted the queue-threading-fix branch December 5, 2018 08:20
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.

AttributeError: 'NoneType' object has no attribute 'tell'
2 participants