You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'FakeStdin' object has no attribute 'encoding' #293
However, it seems silly to write a bunch of code which may or may not do the right thing like this - I'd rather wait to hear that we need to implement something as a workaround. If our FakeStdin doesn't do something, it shouldn't implement it unless faking it makes things better for users. @myint, interested to hear what you and others think.
I don't know what to do with errors, but apparently need to find out.
@myint I'm looking at all of the attributes of sys.stdin in a vanilla repl and wondering if I should really implement all of them. Do you need this for something, or was this just prospective?
Hm, we should probably add all of these then. Separate issue this example touches on: bpython-curtsies is currently hardcoded for utf-8. Is this a problem?
This looks like a bug that is specific to bpython/curtsiesfrontend/repl.py. Note that curtsiesfrontend.repl.FakeStdin is missing various attributes (and functions) that exists in cli.FakeStdin.
Oof, you're right. @ikanobori think it's worth fixing? We don't have tons of long conversations that evolve over time, but it's always sad to lose history.
Activity
ikanobori commentedon Jul 4, 2014
Fix in https://bitbucket.org/bobf/bpython/pull-request/58/fix-293/diff
Original Comment By:
ikanobori commentedon Jul 4, 2014
The only one I personally encountered was
sys.stdin.encoding. I think it makes sense to hold off on the unused stuff. Thanks.Original Comment By: Steven Myint
ikanobori commentedon Jul 4, 2014
So far I'm looking at adding:
from
cli.FakeStdinisatty(return True)fileno(return 0)from vanilla REPL:
close(sets closed)closed(bool that does nothing)encoding(hardcoded to "UTF8" for now)name('')sys.stdin.newlines(None)seek(nop)tell(nop)truncate(nop)writelines(nop)xreadlines(just alias to readlines for now)However, it seems silly to write a bunch of code which may or may not do the right thing like this - I'd rather wait to hear that we need to implement something as a workaround. If our FakeStdin doesn't do something, it shouldn't implement it unless faking it makes things better for users. @myint, interested to hear what you and others think.
I don't know what to do with
errors, but apparently need to find out.I plan to add
readlater.Original Comment By:
ikanobori commentedon Jul 4, 2014
@myint I'm looking at all of the attributes of sys.stdin in a vanilla repl and wondering if I should really implement all of them. Do you need this for something, or was this just prospective?
Original Comment By:
ikanobori commentedon Jul 4, 2014
Hm, we should probably add all of these then. Separate issue this example touches on: bpython-curtsies is currently hardcoded for utf-8. Is this a problem?
Original Comment By:
ikanobori commentedon Jul 4, 2014
This looks like a bug that is specific to
bpython/curtsiesfrontend/repl.py. Note thatcurtsiesfrontend.repl.FakeStdinis missing various attributes (and functions) that exists incli.FakeStdin.Original Comment By: Steven Myint
fix #293 - add encoding to bpython-curtsies FakeStdin
myint commentedon Jul 5, 2014
So you guys are moving to GitHub? By the way, the comments look quite out of order. Compare this to the original.
thomasballinger commentedon Jul 5, 2014
Oof, you're right. @ikanobori think it's worth fixing? We don't have tons of long conversations that evolve over time, but it's always sad to lose history.
fix #293 - add encoding to bpython-curtsies FakeStdin
Merged in thomasballinger/bpython-for-clean-patch/0.13-bugfix (pull r…
Emulate what "sys.stdout" does for "encoding"