Skip to content

'FakeStdin' object has no attribute 'fileno' #989

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

Open
jkugler opened this issue May 26, 2023 · 1 comment
Open

'FakeStdin' object has no attribute 'fileno' #989

jkugler opened this issue May 26, 2023 · 1 comment

Comments

@jkugler
Copy link

jkugler commented May 26, 2023

I know there has been some discussion on this. #232, for example.

I don't know if this merits trying to figure out a solution, but it would be nice to be able to play with Questionary in BPython. :)

bpython version 0.22.1 on top of Python 3.10.6 /usr/bin/python3
>>> import questionary
>>> questionary.text("What's your name?",).ask()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    questionary.text("What's your name?",).ask()
  File "/home/jkugler/.local/lib/python3.10/site-packages/questionary/prompts/text.py", line 90, in text
    p = PromptSession(
  File "/home/jkugler/.local/lib/python3.10/site-packages/prompt_toolkit/shortcuts/prompt.py", line 477, in __init__
    self.app = self._create_application(editing_mode, erase_when_done)
  File "/home/jkugler/.local/lib/python3.10/site-packages/prompt_toolkit/shortcuts/prompt.py", line 728, in _create_application
    application: Application[_T] = Application(
  File "/home/jkugler/.local/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 274, in __init__
    self.input = input or session.input
  File "/home/jkugler/.local/lib/python3.10/site-packages/prompt_toolkit/application/current.py", line 60, in input
    self._input = create_input()
  File "/home/jkugler/.local/lib/python3.10/site-packages/prompt_toolkit/input/defaults.py", line 52, in create_input
    stdin.fileno()
AttributeError: 'FakeStdin' object has no attribute 'fileno'

If the fix is easy, cool. If it's going to cause large amounts of pain, don't worry about it.

@jkugler
Copy link
Author

jkugler commented May 26, 2023

Works in Python 3.10 REPL

$ python3.10
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import questionary
>>> questionary.text("What's your name?",).ask()
? What's your name? Joshua
'Joshua'

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

No branches or pull requests

1 participant