インタラクティブな Python セッションに bpython を使用していますが、システムを更新して以来、次の問題があります。
bpython3 では:
>>> import sys
>>> sys.stdout.flush
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'FakeStream' object has no attribute 'flush'
ただし、Python3 では:
>>> import sys
>>> sys.stdout.flush
<built-in method flush of _io.TextIOWrapper object at 0x7fab6b7fb708>
IPython3 についても同様です。
では、なぜbpython3sys.stdout
に属性がないのでしょうか? flush
モジュールのソースコードを探しましたsys
が、見つかりませんでした。sysmodule.c
ファイルなども見つかりませんでした。bpython は、このモジュールに他の CLI と同じコードを使用していませんか?
$ bpython3 --version
bpython version 0.12 on top of Python 3.4.2
(C) 2008-2012 Bob Farrell, Andreas Stuehrk et al. See AUTHORS for detail.
$ python3 --version
Python 3.4.2