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

Python: BufferedRWPair Undefined Behavior #3884

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dilanbhalla
Copy link
Contributor

The BufferedRWPair class in the io module does not synchronize accesses to its streams. As noted in the official Python 3 documentation, passing in the same object as the reader and writer is a security warning as it generally leads to undefined/undesired behavior. Should a developer want to use an interface for random access streams, it is recommended to use BufferedRandom instead, which creates both a reader and writer for a singular raw stream, and is generally more tailored for this purpose.

@dilanbhalla dilanbhalla requested a review from a team as a code owner July 3, 2020 02:26
Copy link
Contributor

@tausbn tausbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your (many!) recent contributions. I have added a bit of feedback on this query.

Before you submit any further queries, you should be aware that we're currently rewriting large parts of the Python QL libraries. As such, it may be best to hold off on submitting futher PRs, as these will almost certainly have to be rewritten to use the new API. Once the rewrite is completed (in a few months), we'll be happy to revisit your submissions. 🙂

@dilanbhalla
Copy link
Contributor Author

Hi @tausbn, that makes sense, I completely understand. I have pivoted to other languages where I will be writing queries in the near future. I just fixed my suggestions as well for this query as well as the other few queries I have already as PRs. Would you mind reviewing/considering these for merging since I already have them here? Thank you!

@dilanbhalla dilanbhalla requested a review from tausbn July 12, 2020 21:25
@adityasharad adityasharad changed the base branch from master to main August 14, 2020 18:33
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