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

Fix #1530 #1902

Closed
wants to merge 2 commits into from
Closed

Fix #1530 #1902

wants to merge 2 commits into from

Conversation

GBeauregard
Copy link
Contributor

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

This is a temporary fix for #1530 rolled up into a PR so I can keep it up to date.

@GBeauregard
Copy link
Contributor Author

GBeauregard commented Feb 1, 2022

ah apparently I'll need to make my own branch (to be able to update it) :\

@GBeauregard GBeauregard closed this Feb 1, 2022
@willmcgugan
Copy link
Collaborator

@GBeauregard This may fix the error, but it breaks the intended behaviour.

The context manager in Console does not lock any threads. It is intended to prevent interleaving in output when writing from multiple threads. It does this by writing to a thread-local buffer and only write to the console on exit.

It is more efficient this way because there is no waiting for exclusive access from threads.

Adding the thread lock will break this behaviour.

@GBeauregard
Copy link
Contributor Author

GBeauregard commented Feb 1, 2022

One idea I had is writing to the console while a live display is active could be disallowed; any valid usage that won't run into #1530 can get by with writing to the live display's console instance directly. This prevents anyone accidentally relying on multithreading.

None of this fixes the issue, but it does stop library users from being able to hit it in newly developed code.

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

3 participants