Repository navigation
Added fileno support to FakeOutput - #616
Merged
thomasballinger merged 1 commit intoJun 6, 2016
Merged
Conversation
Contributor
Author
|
This also fixes #612. |
Member
|
Thanks @caleb1994. I guess now if a library writes to this file descriptor that we'll have display problems, but that seems better than the libs not being importable. Note to myself: I wonder if putting a pipe there and letting things write to it and catching the data being written so we could integrate it would be useful? Would this break a lot of libs that expect a tty on stdout instead of a pipe? |
Contributor
|
hrm, this has been rejected in the past for various reasons. Essentially since we have never figured out what it would mean to operate on the fileno. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some applications that use curses require that the object in
sys.stdoutbe a file with the a method calledfileno. In order to facilitate this, afilenomethod was added to the FakeOutput object. An extra named parameter was added to the constructor as well to facilitate choosing the result of thefilenomethod. The default value is1(or standard output).The two allocations of FakeOutput (for stderr and stdout) were also changed to specify the file number to be returned by
fileno.These additions do not effect any existing code, but allow users to import libraries such as pwntools while using bpython.