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

Console error when running in IDLE on Windows #94

Open
mehrdadn opened this issue Mar 28, 2019 · 1 comment
Open

Console error when running in IDLE on Windows #94

mehrdadn opened this issue Mar 28, 2019 · 1 comment

Comments

@mehrdadn
Copy link

  • parglare version: 0.8.0
  • Python version: 3.7.0
  • Operating System: Windows 10 x64

When I run the introductory example in IDLE, I get the following error, which shouldn't happen:

>>> parser = Parser(g, debug=True, actions=actions)

Traceback (most recent call last):
  File "<pyshell#27>", line 1, in <module>
    parser = Parser(g, debug=True, actions=actions)
  File "...\parglare\parser.py", line 90, in __init__
    self.print_debug()
  File "...\parglare\parser.py", line 123, in print_debug
    self.table.print_debug()
  File "...\parglare\tables\__init__.py", line 468, in print_debug
    a_print("*** STATES ***", new_line=True)
  File "...\parglare\termui.py", line 64, in a_print
    styled_print(header, content, level, new_line, S_ATTENTION)
  File "...\parglare\termui.py", line 56, in styled_print
    prints(style(header, content, level, new_line, header_style, width))
  File "...\parglare\termui.py", line 17, in prints
    click.echo(style(message, s), color=colors)
  File "...\click\utils.py", line 217, in echo
    file = _default_text_stdout()
  File "...\click\_compat.py", line 621, in func
    rv = wrapper_func()
  File "...\click\_compat.py", line 385, in get_text_stdout
    rv = _get_windows_console_stream(sys.stdout, encoding, errors)
  File "...\click\_winconsole.py", line 261, in _get_windows_console_stream
    func = _stream_factories.get(f.fileno())
io.UnsupportedOperation: fileno

It seems that the issue occurs because the output stream isn't an actual console. It doesn't happen in an actual console.

@igordejanovic
Copy link
Owner

igordejanovic commented Mar 29, 2019

I can't be sure since I don't use IDLE or Win. But from the stack trace I guess you are right. It seems that the problem is that its not a proper console required by the click library.

Thanks for the report. Good to know that the problem exists.

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

2 participants